user-pic

Aristotle

  • Commented on Signatures vs. Methods
    If you have any interest in interoperating with Perl code written before this new syntax then none of this arity-based dispatch is even on the table. How is this going to be reflected in the package stash? With an arity-mangled...
  • Commented on Why Perl 5 benefits is never talked in Perl Weekly Challenge?
    No need to be sorry. As you’re finding out, blogs.perl.org is not a venue where it’s terribly effective to ask a question like this. But it’s absolutely an appropriate venue to ask it. (On Twitter it may or may not...
  • Commented on Reusing data with YAML Anchors, Aliases and Merge Keys
    I’m not yet sure that the implementation will be trivial Yes, I only meant trivial in the sense that you don’t have to resort to any trickery or low-level wizardry or XS or anything like that to create aliases of...
  • Commented on Reusing data with YAML Anchors, Aliases and Merge Keys
    On newer Perls with refaliasing, it should be trivial to implement scalar aliases. YAML::PP could use that. On older Perls, Perl-based but non-pure-Perl YAML implementations can use Array::RefElem as a lightweight form of the refaliasing feature. Its drawback compared to...
  • Commented on TIL - Object Method: Named Arguments Unpacking
    For a couple of years now I’ve been writing the opening line of my methods as my ( $self, ... ) = ( shift, @_ ); Of course an %args slots right in there. The point to this two-fold. First...
  • Commented on Perl Weekly Challenge: Week 2
    And yes, the contents of the post is repeated twice, but I don't know what to do about it: in the edit window, it appears only once. An article consists of the content of the BODY tab followed by the...
  • Commented on Perl Weekly Challenge: Week 2
    Maybe it's been copied into both BODY and EXTENDED tabs? That’s exactly what happened....
  • Commented on Perl Weekly Challenge: Week 2
    You can use perl -pe '$_+=0' for the leading zeroes in Perl 5 too....
  • Commented on Perl Dependency Checking
    The dependency metadata in a CPAN distribution is independent from the code that actually loads the needed modules at runtime, so the two can diverge, and occasionally they do. But it gets noticed quite quickly, most of the time –...
  • Commented on What's going on here?
    If it were taking `@_[0,1]` as a scalar parameter, it would be printing out `2`. Incorrect. Replace sprintf with scalar and you will see that the result is exactly the same as you see here. That’s because @_[0,1] is a...
  • Commented on The Exception That Rather Proves the Rule
    If you absolutely cannot maintain your scripts (ie want them to live forever unmaintained) It’s not that I can. It goes back to the question you posed: “what does [maintaining such a script to keep it running] gain for the...
  • Commented on The Exception That Rather Proves the Rule
    If you have some argument for why the presented code is preferable to other frameworks, I’m all ears. It’s the one you won’t want to hear. I have some Plack CGI scripts on a machine where I do not have...
  • Commented on The Exception That Rather Proves the Rule
    Hmm. How much of a role does Plack play in that app? It parses the request parameters. That’s it. That’s the entirety of the reason that their codebase doesn’t qualify as raw PSGI. They don’t even use Plack::Response (I often...
  • Commented on Don't use something or another
    There are legitimate uses for eval when you are doing language-level stuff. I’m finding it hard to think of how to circumscribe them with a reasonably simple and reasonably accurate criterion though. To put it unhelpfully abstractly, eval is an...
  • Commented on I'm fully covered
    It doesn’t make any difference to users whether MetaCPAN runs the coverage checking itself or endorses the data generated by another service. The weight given to the data by MetaCPAN is the same....
  • Commented on Modern Perl CGI
    Dave, that won’t work exactly as written because plackup is a script, and you can only use binaries in the shebang. You would have to use #!/usr/bin/env plackup But I recommend against this. Going through plackup via the shebang line...
  • Posted Modern Perl CGI to Aristotle

    The contemporarily unique strengths of CGI as a deployment strategy are that CGI scripts ⓐ can just be dumped in the filesystem to deploy them and ⓑ do not have any of the issues of long-running processes: they tie up no resources when not in use and are extremely reliable because of the…

  • Commented on Modern Perl CGI
    Another objection is that the first script will work on basically any server, and will not require changes more or less ever, whereas the second script basically requires the ability to deploy it in a way that includes the exact...
  • Commented on I'm fully covered
    In my opinion, marking private subroutines with a leading underscore is a de facto standard in the perl world. So, independently of the coverage issue, it would be a good thing to do. That would be a fair stance to...
  • Commented on Which edges cases could perl shed to make it easier to parse?
    It's about making a grammar that something else can use. Oh. Hmm. PPI?...
  • Commented on Which edges cases could perl shed to make it easier to parse?
    Isn’t that more or less what Kurila was? Also, the Perl-alike Stevan wanted to attempt. And at least two other projects whose names escape me. I’m pretty sure there were more of them before my time as well. History says...
  • Commented on Could anybody explain this code?
    Merlyn: The bit at the end is not meaningless. It works with the -s switch that’s passed to the perl call. It makes the value of the -i switch into the value of the variable $i in the code. And...
  • Commented on Could anybody explain this code?
    As others have said, your script looks like an unfinished attempt to solve a problem, and doesn’t actually do much. It just uncompresses the *dat.gz files in the current directory. For each of the files it also prints a line...
  • Commented on A widespread and broken Perl idiom
    Oh, wow. I had to go all the way to $_ = [ __FILE__ ] for local *ARGV; to make it work in a single statement. Even something like *{ \local *ARGV } = [ __FILE__ ]; wouldn’t work, despite...
  • Commented on A widespread and broken Perl idiom
    I became aware of this as far back as my PerlMonks days, so at least 15 years ago. Namely, I memorised that I should be writing the idiom like this: my $content = do { local ( *ARGV, $/ )...
  • Commented on Wallflower improvements and issues
    what if the application generated a list of links that are expected to exist I was going to shout “sitemaps!” before I read on and saw you already have that covered. 😊 X-No-Archive An HTTP application should not be looking...
  • Commented on Wallflower improvements and issues
    The most helpful tip I saw is to think of 12:01. Is that in the AM or PM block? Well the hour is in the same block. That means 12AM is midnight, because 1 minute after midnight is AM, and...
  • Commented on At Perl Station
    There are posts on here that annoy me (which I just skip – I’m not the police and don’t play it on reddit) but this isn’t one of them....
  • Commented on StackOverflow that!
    Sure, feel free. 😊...
  • Commented on Proposed new data structure: Pile
    First I thought this was silly. Then I saw it was a joke, but I thought it was a stupid one. Then I got to the end. Hah! 😊...
Subscribe to feed Recent Actions from Aristotle

  • Matthew Persico commented on TIL - Object Method: Named Arguments Unpacking

    I always preferred

    my $self = shift;
    my %args = @_;

    because I usually do

    my $self = shift;
    my %args = (
    param1 => "0", ## default value
    param2 => undef, ## documenting
    @_);

    so that I can set reasonable defaults and don't have to do if exists all over the place.

  • tinita commented on Reusing data with YAML Anchors, Aliases and Merge Keys

    Yeah, I read about the refaliasing feature.

    For older perls I had a look at Data::Alias. But I didn't know about Array::RefElem before.
    With "slot in a container" you mean, that I can only add an alias to an array or hash element?

    I'm not yet sure that the implementation will be trivial, because at the time I parse and store the alias, it is stored in a temporary structure, which will be rearranged during the constructing process.

    It's implemented like that because I provide callbacks for custom constructurs. A custom constructor for a mapping will get the keys …

  • tinita commented on Reusing data with YAML Anchors, Aliases and Merge Keys

    My previous reply was a reply to your comment, Aristotle. Due to the commenting bug here that got lost.

  • Grinnz commented on Why Perl 5 benefits is never talked in Perl Weekly Challenge?

    Yes of course; my use of the word "appropriate" referred specifically to the effectiveness of the medium for that format, and what mediums expect such a format.

  • haj commented on Signatures vs. Methods

    While I can imagine several scenarios where multiple inheritance would come in handy, method resolution based on arity seems to be a bad idea in all of them.

    If all three classes in question belong to the same project and are unlikely to be used somewhere else, then relying on a resolution method which only works if the methods in question happen to have a different number of arguments is indeed a code smell. Consider renaming DrunkenMother::shout to echo instead.

    If, on the other hand, at least one of the parent classes leads a life of its…

Subscribe to feed Responses to Comments from Aristotle

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.