Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Obfuscated Glob

by Daruma (Curate)
on Aug 21, 2002 at 08:36 UTC ( #191672=obfuscated: print w/ replies, xml ) Need Help??

Greetings, fellow Monks!

This is my second Obfuscated Perl attempt. My first Obfuscated Perl Attempt was not too terribly obfuscated. My hopes are that this is a bit more challenging to work through.

sub _{'h'};%_=('p');@_=qw(a);$_='j';$;=\*_; print ${*${;}},@{*${;}},%{*${;}},&{*${;}};
-Daruma

Comment on Obfuscated Glob
Download Code
Re: Obfuscated Glob
by RMGir (Prior) on Aug 21, 2002 at 16:47 UTC
    Wow, that's kind of cool. It's useful as an intro to typeglobs, too...

    Maybe I like it because I've finally found a JAPH I was able to decode by inspection :)

    SPOILER WARNING:

    Basically, this sets up sub _, %_, @_, and $_ to point to letters 'h', 'p', 'a', and 'j'. %_ actually maps 'p'=>undef.

    $; is then set to a reference to *_, the typeglob for all things named _.

    The print line then prints the results of dereferencing that typeglob reference as a scalar ('j'), an array ('a'), a hash ('p' and undef, which is printed as just 'p'), and a subroutine, 'h'.

    Very cool...
    --
    Mike

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-07-04 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls