Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: I heart Perl

by chargrill (Parson)
on Feb 14, 2006 at 23:37 UTC ( [id://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 +" );

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://530258]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-24 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found