user-pic

Aristotle

  • Commented on Converting glob patterns to efficient regexes in Perl and JavaScript
    The short-for-me/long-for-you version of the answer would be “read the Friedl book”. 😊...
  • Commented on Converting glob patterns to efficient regexes in Perl and JavaScript
    Because of (*PRUNE). The .* requires backtracking to match: it gobbles up everything first, then relies on backtracking to give up enough of the matched string to make the match pass. (That’s why they say “death to dot star”.) But...
  • Commented on \d does not validate numbers
    That’s what /a is for....
  • Posted Alan Kay’s critique of the TPF grants program to Aristotle

    Alan Kay:

    ="https://www.quora.com/What-made-Xerox-PARC-special-Who-else-today-is-like…
  • Commented on How fast can you try?
    Well, now. That does indeed look a lot more plausible. TT vs TTM differ only in whether the SV returned from caller gets assigned to an SV on the pad, which is clearly going to be a noise-level difference. But...
  • Commented on How fast can you try?
    Actually, on repeated look, it seems this benchmark is probably entirely bogus… ☹️ The current results say that without the catch clause, CPAN Try::Tiny is slower than master (with or without renaming (i.e. TTT)), but with the catch clause, CPAN...
  • Commented on How fast can you try?
    Had I left it out I'm sure I would have caught flak for that instead. Not from me, at least. :-) Any flak from my part was limited to the omission of eval, because that’s what TTT is for –...
  • Commented on How fast can you try?
    Even so, though… I’m still interested in that result, but this benchmark lineup misunderstands the purpose of TTT. It pitches it against competition it wasn’t meant for. Also, the most important competitor is missing. Perl 5.14 made raw eval sane, and...
  • Commented on How fast can you try?
    Can you retry with current Try::Tiny master?...
  • Commented on Dist::Zilla @Starter - Revision 2
    Well, the thing is, in tarballs, the POD dump is a supremely unuseful README. And the core Dist::Zilla [Readme] has the distinction of managing to be even more unuseful. Even the [Readme::Brief] output is not amazing… but it’s at least...
  • Commented on Dist::Zilla @Starter - Revision 2
    May I advocate [Readme::Brief] instead?...
  • Commented on Something New Every Day
    Sometimes it seems like everybody knows, other times I’m surprised how many don’t....
  • Commented on Are Restricted/Locked Hashes A Failed Experiment?
    should ALL hashes support locking, or would it be sufficient to have a bespoke lockable hash to use with fields.pm and Hash::Util? Given I proposed the bespoke locked hash implementation, it’s clear what I’d answer, but I’m not up on...
  • Commented on Are Restricted/Locked Hashes A Failed Experiment?
    I would imagine locked hashes would be one specific hash implementation, and Hash::Util::lock_keys would continue to work by switching the hash from its current hash implementation to a locked hash. It would be a costly operation, but nobody who doesn’t...
  • Commented on Three Sort Functions
    Do not miss Sort::Key. It’s faster and leaves the code more readable than if you try to write a faster sort in pure Perl....
  • Commented on Swapping Things
    Because this user’s posts are all written in (or possibly pasted into) the rich text editor, not as HTML or Markdown. The class="prettyprint" bit is not even necessary to add, btw. That gets inserted by the syntax highlighter automatically....
  • Commented on qk: Quote Membership Hash Keys
    I’m not a fan of either proposal, though especially not of qa(), because of how little they offer, and how easily they are replicated by just chucking a few functions into List::Util: our $cars_ref = array qw(sedan hatchback coupe); our...
  • Commented on Any module to convert 'whitish' to 'white'?
    The term of art for this is stemming....
  • Commented on You can import your Metacpan favorites into perlmodules.net!
    Excellent! That takes care of the reason I didn’t get into it before....
  • Commented on Announcing Mojolicious::Plugin::Routes::Restful
    DELETE or PUT route to a collection resource […] will give you a 404. Should be 405...
  • Commented on Fake Amazon Book Reviews Are Hurting My Book
    Most of the links are dead or largely deleted now, so I cannot test this thing against them, unfortunately; in any case, I just saw Fakespot, which, if it does what it promises even reasonably well (namely, grade reviews by...
  • Commented on Reply to David Golden "Comparison of Class::Tiny and Object::Simple"
    Sorry, I have mistake? In Past? Not in the past either. David Golden is not the pumpking now and has never been the pumpking before. Perl calls constructors and destructors in correct order if we use only single inheritance. This...
  • Commented on Do you need "Fast Perl"? Look at "Static Perl" project at once.
    There is already a thing called staticperl on CPAN… maybe pick a different name to avoid confusion?...
  • Commented on Simplest class builder "Object::Simple" 3.17 released!
    You can still see the comment if you log in. If you follow the link you will see that they offer training in the absolute basics of dozens of technologies… for several hundred dollars per course. Perl is just one...
  • Commented on Simplest class builder "Object::Simple" 3.17 released!
    Yuki: that was a spam bot. If you see a generic-sounding “wow your blog/article is great” comment with a generic link in it (or a link in the name of the commenter)… that is spam 99.99% of the time....
  • Commented on The Math::BigRat Trap
    That would make the problem go away. But it would do so by foisting Math::BigRat on everyone who installs Math::BigInt::GMP, whether they need BigRat or not....
  • Commented on Do not pass perl globals as arguments to subroutines
    I was never able to figure out exactly what was going on […but…] I have made it a practice ever since That is pretty much cargo cult by definition. 😊 Not that I can fault you for reacting the way...
  • Commented on Do not pass perl globals as arguments to subroutines
    And if you are writing the subroutine, you might want to avoid returning things like this as well, and for similar reasons. Returning a value makes a copy, so it doesn’t suffer from this problem (outside of an :lvalue subroutine...
  • Commented on PRC 2016 - Second Trimester
    And that is why I used "it seems", because I know it is not true. Culture gap I guess. “It seems” usually means “from what I can tell”, i.e. a position you are not necessarily sure about but which you...
  • Commented on Missing Smart Match
    I still believe that "is-an-element-of" is a very frequent operation and would be useful as an operator on its own Probably. (Not sure, but I’m not disagreeing.) That doesn’t necessarily have anything to do with smartmatch though…...
Subscribe to feed Recent Actions from Aristotle

  • Ben Bullock commented on \d does not validate numbers

    Yes, I switched to using [0-9] almost everywhere. I think it's simpler.

  • Karl Williamson commented on \d does not validate numbers

    DEVANAGARI DIGIT NINE, for example, is used by millions of people millions, perhaps billions, of times a day as an essential component of their numbers. I don't know if you are being careless with your terminology, or wrongly arrogant about the place in the universe of [0-9].

    Unicode::UCD::num(), since Perl 5.14, can be used to make sure that a string of digits are all from the same script, so are not spoofing attempts, returning the numeric value the string represents, or undef if it is illegal.

  • Ben Bullock commented on \d does not validate numbers

    > That’s what /a is for.

    As a followup to this article, I am thinking about making another blog post showing how \d is used to match numbers in actual CPAN modules. It's used for number validation in more than a thousand modules, for example here is the matches for /\\d\./:

    http://grep.cpan.me/?q=%5C%5Cd%5C.

    and here is the matches for /\\d\+\./:

    http://grep.cpan.me/?q=%5C%5Cd%5C%2B%5C..*%2F%5Bb-z%5D*a

    Noting your comment, I tried s…

  • fmtyew.tk commented on Converting glob patterns to efficient regexes in Perl and JavaScript

    Confirming no exponential backtracking with all the JS implementations:

    $ d8
    V8 version 6.0.0 (candidate)

    $ jjs -version
    nashorn 9-internal

    $ js --version
    JavaScript-C55.0a1

    $ rhino
    Rhino 1.7 release 3 2017 02 13

    $ seed --version
    Seed 3.8.1

    $ perl -mJE -E'say JE->VERSION'
    0.066

    (Nashorn and Rhino require a String.prototype.repeat polyfill to run.)

  • Joel Berger commented on A Simple Mojolicious/DBI Example

    Before I answer, let me just say that commenting on an ancient post is unlikely to get great responses mostly because the visibility is so low. I only happened to notice because it was on the posting comment dashboard which I rarely look at. In the future, come talk with us http://mojolicious.org/perldoc#SUPPORT

    To your actual question. I think very few of us use MS SQL, mostly just because most of us are on *nix. I think were I you, I’d look for tools like sqitch etc which are intentionally mu…

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.