develooper Front page | perl.fwp | Postings from March 2002

Re: TPR1 post-mortem

Thread Previous | Thread Next
Eugene van der Pijll
March 8, 2002 07:05
Re: TPR1 post-mortem
Message ID:
Can anyone explain this entry to me?

-l $%=!print,/..(?{$%.=$&%9||0+$&&&9})^/while$_=$%||pop

Why does it give the correct result for an argument 0? The while-test
$_=$%||pop evaluates to 0, but the loop is executed once anyway.

And here's another 55 that I came up with:

-l $x+=print,/..(?{$ARGV[$x].=$&%9||0+$&&&9})^/for@ARGV

which is nice, but why doesn't this work:

-l $x+=print,/..(?{$_[$x].=$&%9||0+$&&&9})^/for@_=pop

By the way, congratulations to Ton, and thanks to Dave and Jerome for
the wonderful tournament.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About