http://www.perlmonks.org?node_id=333381


in reply to Re: Perl parser tortured (was: Perl Idioms Explained)
in thread Perl Idioms Explained - my ($foo, $bar) = @{shift(@_)}{qw/ -foo -bar /}

That will be fixed in Perl 6, which will distinguish
${shift} # always an expression in the middle
from
$«shift» # always a literal
It's really quite amazing how much just adding one set of brackets to a language helps.

Replies are listed 'Best First'.
Re: Re: Re: Perl parser tortured (was: Perl Idioms Explained)
by demerphq (Chancellor) on Mar 04, 2004 at 10:55 UTC

    It's really quite amazing how much just adding one set of brackets to a language helps.

    Yeah, but its just really annoying how long it takes the keyboard manufacturers to actually put the new brackets somewhere useful.

    IMO this is something you need to consider, and especially fromt he POV that keyboards vary quite a bit around the world. AltGr-7, AltGr-8, AltGr-9, Algr-10 are where the { [ ] } brackets live in germany which is already frustrating enough for someone that grew up in Canada. I dread having to type these new brackets. But no doubt you are already hip to this problem :-)


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi