[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] -peal'@r=map{$f=$_;map[@$_,$f],@r?@r:[]}@F}for(@r){$_="@$_"'



Neko wrote:

> Let's lower the golf score a bit:
> 
>   perl -pale'@r=map{$f=$_;map[@$_,$f],@r?@r:[]}@F}for(@r){$_="@$_"'
> 
> The BEGIN block gets replaced by the conditional ( @r?@r:[] ).  The -n
> switch changes to -p, so that the END block can be replaced with inverted
> braces ( }for(@r){ ).  And changing the inner map BLOCK to map EXPR saves
> one extra character.
> 
> Hope that actually works. :)
> 
> 
> Neko

Wow, thanks, Kitten!   I was hoping someone would be able to use
Abigail's Inverted Brace Trick  and -p and improve my hamfisted attempt.

Did you bcc the perl journal?  They should assign a designated spy to
read FWP -- Hey spy, are you there?  Do you exist?

__________________________________________________________________
                          David Nicol 816.235.1187 nicold@umkc.edu
echo "Guns don't kill people, people using guns kill people"|perl\
 -pe 's/guns/mirroring software/gi; s/kill people/commit piracy/g'

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe