user-pic

Aristotle

  • Commented on Why I try to avoid Perl's punctuation variables
    More seriously, global variables bad, because action at a distance bad, and to the extent that Abigail’s version of the code is less readable than other formulations I find it’s mostly owing to the distance between setting the punctuation variable...
  • Commented on Why I try to avoid Perl's punctuation variables
    my $query = <<""; SELECT foo, bar, baz FROM sometable WHERE id IN (${\ substr ',?' x @ids, 1 }) What? Oh, we weren’t golfing?...
  • Posted The Coro situation to Aristotle

    Since my recent participation at the QA Hackathon I have become aware that rather more people than I expected do not know the specifics of this situation. Fewer than I expected have heard of it at all, even, although there appears to be some general awareness at the “something happened with…

  • Commented on Test2/Test::Builder Update from the QAH
    Maybe I don't understand what you and Leon wanted to happen. Yes, sorry, I’ll be publishing a long-form, detailed version of the proposal very soon. I’ve realised the proposal is (either largely or entirely) non-understood – the abridged version I...
  • Commented on Test2/Test::Builder Update from the QAH
    For TCM to work with Test2, every single module you use to output tests must also use Test2. This, however, I will call unqualified nonsense. Let me demonstrate to you why: Test::More will not be changing at all. Yet it...
  • Commented on Test2/Test::Builder Update from the QAH
    The 'explicit opt-in' approach works only until people start porting existing extensions on CPAN, which a number of Test:: authors have expressed an interest in, and then users would see far, far weirder breakages than what we're currently doing is...
  • Posted A very stupid, over-clever scoping-based importing trick to Aristotle

    In some code I’m working on, I use a module which exposes a whole bunch of package variables as part of its public interface. It does not export them, however. I could refer to them directly by prefixing them all with Some::Module::, but that would be ugly and…

  • Commented on Test2/Test::Builder Update from the QAH
    Facts will now be the judge of those beliefs. (Not the degree of agreement. Not the level of respect. Not the tone of the discussion.)...
  • Commented on Test2/Test::Builder Update from the QAH
    I think the final decision does accurately reflect all the concerns that were raised and the preparations made to mitigate them. The point is to address, not necessarily to accept. I do believe issues were thoroughly and respectfully addressed with...
  • Commented on Private Moose Attributes
    I think this is what you’re after: has request => ( is => 'bare', isa => 'Catalyst::Request', trigger => sub { my ( $self, $value ) = ( shift, @_ ); # extract and store country, language, etc here ......
  • Commented on Upping minimum version for Devel::Cover
    So the question to ask is not: "who is still using 5.6.1 for production code" but "who is developing on 5.6.1 and has only 5.6.1 available on that machine?". So you check code coverage on e.g. 5.22 on your dev...
  • Commented on The Perl Toolchain: PAUSE and CPAN
    Sounds like local::lib to me, not Perlbrew/Berrybrew....
  • Commented on Upping minimum version for Devel::Cover
    That approach privileges the wants of a hypothetical user over the needs of a very real library author. It does? By which mechanism?...
  • Commented on It's never too late to find a bug
    That’s terribly over-clever for my taste. I’d probably just go with the boring approach: my ( $r, @v, @o ) = shift; push @{ ref eq 'HASH' ? \@o : \@v }, $_ for @_; my $v = shift @v;...
  • Commented on More on YAML, syck looks much better
    If the dude writing on that domain now is _why, I’ll eat a straw broom....
  • Commented on Not so new shiny things: LWP::Protocol::PSGI
    [Note also my Plack::Middleware::MockProxyFrontend, which is the same idea in a different context: instead of making every LWP request go to your PSGI app, it makes every request from your browser go to your PSGI app – no matter which...
  • Commented on Alien::Base and Module::Build
    The modules that have configure_requires of Alien::Base are simply wrong. How many are there? If there are only a handful, then OK – I guess we can eat the breakage and move on. But, maybe we still shouldn’t. And if...
  • Commented on Alien::Base and Module::Build
    Can I try to change your mind? The Alien::Base stuff already on BackPAN is never going to be fixed; how about making an Alien::Base::Core (or some such) instead, for the installer-independent logic, and then Alien::Base::MakeMaker for the new EUMM stuff....
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Meanwhile the way I actually need it to work right now is not even an option. :-) […] I see how to work around it, thanks to your continued efforts to enlighten me. You’re aware that sentence 2 there directly...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Another try: Then (?: and (?= would mean the exact same thing. Wait ... what? I don't follow that at all. A(?:B) means an "A" followed by a "B." A(?=B) means an "A" followed by a "B," except don't include...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Why, "AC" of course. If tell you to match "ABC" but leave the "B" out, what else could you possibly get? And what would @- and @+ contain?...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    That surprise is ignorance leaving your mind. :-) Please do yourself a favour and read Mastering Regular Expressions. You seem to have a mistaken mental model of how regexps work; that book will beat you into shape....
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    A(?=B) means an "A" followed by a "B," except don't include the "B" in the match string. I'm not sure how the consecutive-ness of anything would impact that. Then if you could write 'ABC' =~ /(A(?=B)C)/ and have it match...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    if two consecutive zero-length tokens need to match, they must both match at the same point? Yes. Consecutive tokens should match consecutively, it seems to me, regardless of their length. That wouldn’t make any sense. Then (?: and (?= would...
  • Commented on A Naïve SQL Shell
    If you can install modules, DBI::Shell and you’re done....
  • Commented on Python is The New "Write-Only, Linenoise" Language
    my @list1 = 'a' .. 'h'; my @list2 = <x y>; my $n = 3; # (where did this go in your translation?) say flat roundrobin @list1.rotor($n - 1, :partial), @list2;...
  • Commented on Python is The New "Write-Only, Linenoise" Language
    ['a', 'b', 'x', 'c', 'd', 'y', 'e', 'f', 'g', 'h'] […] # OUTPUT«a x b y c d e f g h» Uhm, you did notice that “a b x c d y” is not the same thing as...
  • Commented on Python is The New "Write-Only, Linenoise" Language
    say join '', (u.comb Z l.comb) You can also do either of these: say [~] (u.comb Z~ l.comb); say [~] flat (u.comb Z l.comb);...
  • Posted Perl&#160;6 to Aristotle

    Wow, you people.

  • Posted Making local::lib real easy to use to Aristotle

    In bash, at least.

    Just paste this (on your command line or into .bashrc or wherever else you want):

    perl-lib() { eval "`perl -M'local::lib @ARGV' - "$@" 0<&-`" ; }
    

    Then you can just say things li…

Subscribe to feed Recent Actions from Aristotle

  • Aaron Crane commented on Why I try to avoid Perl's punctuation variables

    There's at least one valid use of $" that can't be replaced with join:

    my @regexes = list_of_qr_objects();
    my $combined = do { local $" = '|'; qr/@regexes/ };
    

    If any of the regex objects contain (?{ }) or (??{ }) constructs, using join would decompile and reparse the code. That in turn would require use re 'eval' in scope for the final qr, and even then it would break the use of any lexical variables that those code blocks might close over.

    However, qr/@regexes/

  • Joel Berger commented on Why I try to avoid Perl's punctuation variables

    This is one of the few examples where i know an even better trick, at least as long as you are using DBD::Pg

    my $query = <<"END_SQL";
        SELECT  foo, bar, baz
          FROM  SomeTable
        WHERE  id = ANY(?)
    END_SQL
    

    And then pass an array reference as the value. \o/

  • Merlyn Kline commented on Why I try to avoid Perl's punctuation variables

    I'm with Ovid. I love that perl will let me do very concise things and has all these features, but they should be used appropriately. Invoking perl with -e on the command line to do some one-off task is often only really possible this way, and knocking up a quick helper utility for something is much quicker and easier with these features.

    But Abigail's example wouldn't make it past review onto a production server. I'm on a multi-decade project and there's an inevitable turnover of staff so maintainability of code is critical; moreso even than having it work properly (maintainable but…

  • Steve Nolte commented on Why I try to avoid Perl's punctuation variables

    I applaud this article and others like it. At $work we are constantly fighting bugs in code that is "too clever" and not explicit. Also fascinating to see what may seem obvious to some (e.g. the Babycart operator) but quite confusing to newbies.

  • Yuki Kimoto commented on Alien::Base and Module::Build

    FFI::Platypus seems to be good product. I am reading documentation now.

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.