user-pic

Aristotle

  • Commented on Narrowly destricted refs
    I’m afraid you are just being taken for a ride by the peephole optimiser: $ perl -l $_ = "boo"; sub x : lvalue { do { $_ } } x = "yay"; print yay $ perl -l $_ =...
  • Commented on Narrowly destricted refs
    For that example in isolation, I agree, that would be the cherry on top. It falls apart in the push example though. And if you have both cases in close proximity, I’d rather preserve symmetry than simplify just one of...
  • Posted Narrowly destricted refs to Aristotle
    *{; no strict 'refs'; \*{ "${pkg}::type" } } = sub () { $type };
    # ... and so on

    I really don’t feel like I have anything to add but I suppose it may not be obvious that the point of this …

  • Commented on My Y2020 Bug
    Thank you very much for Modern functions in a post-modern language. You provided the impetus to write it. 🙂 There had been other discussions about the new functions, but the conversation in this comment thread is what pushed me to...
  • Commented on My Y2020 Bug
    Isn’t Time::Piece->strptime( '1970-01-01', '%Y-%m-%d' ) far more defensive in that sense than either timegm( 0, 0, 0, 1, 0, 1970 ) or timegm_modern( 0, 0, 0, 1, 0, 1970 )?(Isn’t it great that that says … 1, 0, 1970 rather...
  • Posted Modern functions in a post-modern language to Aristotle

    The new _modern function variants in Time::Local have come up a few times lately. I have some thoughts on them, but presenting my position dispassionately enough to…

  • Commented on My Y2020 Bug
    Is that in fact a better response? It comes at the cost of an additional dependency that old perls will have to install from CPAN, and every dependency installed from CPAN has the potential to come at the cost of...
  • Commented on A Static Archive of use.perl.org
    Excellent! The icing on the cake would be if the redirect mapping also included the later static(ish?)-site URL structure: Old: http://use.perl.org/use.perl.org/_Aristotle/journal/33448.html New: https://use-perl.github.io/user/Aristotle/journal/33448/ It would be ideal if the redirector’s 404 logs were accessible, to be able to see if...
  • Commented on A Static Archive of use.perl.org
    I’d prefer not pointing use.perl.org directly at this mirror due to the difference in URL structure. But it would be nice to point the domain at a redirector that 301s old URLs to the URLs on this new mirror, the...
  • Commented on Can't post a comment here -- dunno why
    Previewing doesn’t kill the session. It’s just that the submit action on the preview page somehow fails to find or load the session correctly. But with the form on the article page, submitting works. So all you need to do...
  • Commented on Larry has approved renaming Perl 6 to raku
    These assume that a major release is the time when perhaps we can break backwards-compatability. Et tu, Ovid? Whyyyyy does everyone keep saying that, why? The whole point of Perl 6 was to be where compatibility would be broken. Not...
  • 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...
Subscribe to feed Recent Actions from Aristotle

  • Tom Wyant commented on My Y2020 Bug

    So far my personal problem seems limited to a test where I specified a two-digit year. That is now corrected, and that may be all I do.

    However, had the code originally been written with the then-unavailable *_modern variants, this bug would have been caught as soon as it was tested, rather than a decade or so later when it actually manifested.

    I have great faith in my own ability to write buggy code, and tend to program defensively as a result. Using the modern variants strikes me as defensive programming. Not using them strikes me as assuming that I will

  • Tom Wyant commented on My Y2020 Bug

    Before I respond to your comment above, thank you very much for Modern functions in a post-modern language. If only we had a core timegm() that round-tripped with gmtime()!

    strptime() does not go back before 1900. The module in question is about satellite positions, and my correspondence says it is in use professionally (which is why I am a bit paranoid about accuracy) and strptime() would suffice for that.

    But the support modules have taken on …

  • Toby Inkster commented on Narrowly destricted refs

    Interestingly, do blocks do work as an lvalue if they are the final statement in an lvalue sub.

  • David Cantrell commented on SSH Can Do That? Productivity Tips for Working with Remote Servers

    For persistent connections I find it better to use the %C token in ControlPath. It produces a shorter string, so will help get around some path length restrictions. Also, that really ought not to be a path in a world-readable place like /tmp!

  • Smylers commented on SSH Can Do That? Productivity Tips for Working with Remote Servers

    Both good ideas. %C didn't exist when I wrote the above.

    On a laptop only used by me, I was using /tmp/ (it avoids need to know your username to put in the config), but for shared computers it isn't a good idea.

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 with a design donated by Six Apart, Ltd.