Fair enough... Your first obfuscation, and my first crack at working one out....
SPOILER:
First
$_ is set to a confusing looking string with lots of brackets & stuff in it.
Next the regex
y is used with the
d modifier. (It's an alias for
tr) This converts all of the weird looking characters to legal hex code characters.
d deletes all characters found in SEARCHLIST that do not have a corresponding character in REPLACEMENTLIST
Then
$h is set to
"H8" which will be used as a parameter for
pack, telling it to use Hexidecial with high nybble first.
pack is then called (why didn't you just omit
$h altogether & write
$_=pack("H8",$_) ???)
This produces a 4 letter string which is translated (this time actually using
tr) to
"JAPH"
Then a newline is tacked onto the end & the result is printed.
What makes this obfuscation work is the use of escaped delimiter characters in the Regular Expressions, they make it difficult to follow. 8-P
It kind of reminds me of the
solitare encryption proggy written in the Neal Stepenson Book, Cryptonomicon.
--
Wait! This isn't a Parachute, it's a Backpack!!!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.