Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: I heart Perl

by chargrill (Parson)
on Feb 14, 2006 at 23:37 UTC ( #530258=note: print w/ replies, xml ) Need Help??


in reply to I heart Perl

Beautiful!

And because it's only one statement (one 'variable' plus a wicked /x'd regex) perl -MO=Deparse doesn't even begin to shed any light on this!

$ perl -MO=Deparse valentine.pl "Sh ELoV\n eSMeshEl OvEsmeNO\n tsHeloVeSM EShELOVESm\ +n eNOTShEloVes mESheLovesMe\nnoTsHELovEsMESHelOVeSmEnotS\nHeLOVeSMESH +ElOvESMENotSHeLo\n VesmEShELovEsmENOTsHELOVE\n smEsHELOveSMeNoTshELO +Ve\n SmesHElOVesmEnOTSheLO\n vEsMeshELoVESmEnoTS\n HELOvEsM" + =~ /(((\w )\W*(?{$^R.(0+( q{a}lt$3))})) {8}(?{print +pack"B8" ,$^Rand ""})) +/x; valentine.pl syntax OK

/me waits for the vote fairy to give him some more votes this evening



--chargrill
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );


Comment on Re: I heart Perl
Select or Download Code
Re^2: I heart Perl
by chargrill (Parson) on Feb 15, 2006 at 16:17 UTC

    I'm still puzzling through how japhy got from perlre's definition of (?{ ... }) to his use of it... but I can at least demonstrate what's happening.

    Very nice! This will certainly inspire me to wrap my head around this use of (?{...}) a bit better. Or a lot better :)



    --chargrill
    $/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://530258]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-08-21 03:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls