Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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


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 "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; syntax OK

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

$/ = 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 :)

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://530258]
[choroba]: Well, merging two hashes recursivelly is not that hard either, but...
[Corion]: choroba: Yeah - I think I used (and extended) Hash::Merge for recursive merging
[Corion]: I still wonder if I should maybe publish Config::Collect, which (I think) is the dumb hash merger
[Corion]: It still needs some more ways of specifying defaults (in memory) and loading files (user-supplied loader(s)/ callbacks?), and the app-specific parts ripped out...
[Corion]: Also, the Config::Spec part(s) need more work to document how to pass in things from a data structure and from %ENV (or any other hash)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2018-02-23 19:28 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.