I enjoyed this one, so I decided to deobfu it. I don't normally like many japhs, as they are too simple, but this one isn't. It is quite tricky without using hardly any minor obfusucations at all. Well done, ++ :)
#!/usr/bin/perl # shebang : NO -w!! :)
# NO STRICT ?!?!?! :)
$a='grep';
# sets $a to the literal string 'grep'
@a=(g..r,e..p);
# sets @a to qw(g h i j k l m n o p q r e
# f g h i j k l m n o p)
printf( "%c%c%c%c",
# printf. This will work like chr; the
# first 4 arguments will be turned into
# ascii characters regardless of what
# they are. printf, like print, also
# takes a list as an argument; take a
# guess on how many he is passing :)
($a=~y;grep;map;)+70,
# argument uno. First off, he is taking the
# transliteration (thats a y delimited by ;) in scalar
# context, so that it will return the number of characters
# replaced, which is 4. Then he adds 70 for a result of 74
# as a side effect, $a is now equal to mapp.
65,
# argument 2. If you can't figure out what it equals,
# you are hearby banished from the monastery!
length(join(';',reverse(split //,++$a))) + $#a + 50,
# arg 3. Starting innermost: first, $a is magically ++ed
# to make it mapq. Then its split on nothing, returning,
# a list of length 4. this is reversed, and then joined
# with ; to make a string of 'q;e;r;g'. Finally, the length
# of that is returned (7), added to 50, and finally
# the last index of @a (24) is added upon that. The result is 81.
# next up is arg #4.
$a=~s;mapq;grep\;grep\;grep;
# the substitution operator is applied to $a, making the value
# of $a = grep;grep;grep. Don't be fooled by the backslashed
# ; As a side effect, the substitution is true, so 1 is
# returned.
+56+
# thats added to 56 (now 57)
$a=~y;g;j;
# $a is now jrep;jrep;jrep, also, as a side effect, 3 (the
# number of substitutions) is returned (now 60)
+
# $a is is jaep;jaep;jaep (63)
$a=~y;r;a;
+
# $a is jamp;jamp;jamp (66)
$a=~y;e;m;
+
# $a is jamh;jamh;jamh (69)
$a=~y;p;h;
+
# $a is japh;japh;japh (72)
$a=~tr;m;p;
);
# japh is now printed (i think), but just for kicks,
# he decides to through this in, making $a="japh" :)
$a=(split/;/,$a)[0];
|