Obfuscated Perl

morse.pl

Morse code JAPH.

#!/usr/bin/perl -- 07/29/2000
# Just      .--- ..- ... -
# another   .- -. --- - .... . .-.
# Perl      .--. . .-. .-..
# hacker    .... .- -.-. -.- . .-.
[email protected]____=split//,'';
[email protected]___=split//,'hlrou';
[email protected]__=split//,'aPent';
$/[email protected]=split//,'.rekc re hta sJ';
sub ____{print$____[--$____];}
sub ___{print$___[--$___];}
sub __{print$__[--$__];}
sub _{print$.[--$/];}

_.___.._.__;
_._.__.___..._._, _._.__..___;
_.__.._._.___;
_.___.__._._._.._._;

Signature version: (03/21/2001)

for$m(qw(hlrou aPent .rekc_re_hta_sJ)){($c=$m)=~y/_/ /;$a=_ x(4-++$i);$_.=
"\$s$i=\@s$i=split//,'$c';sub $a {print\$s$i [--\$s$i]}\n";}$_.="_.___.._.
__;_._.__.___..._._, _._.__..___; _.__.._._.___;_.___.__._._._.._._;";eval

Regex Quine

Copy this to a file named regexq.pl and run it:

/+*/: ?+*{} follows nothing in regexp at regexq.pl line 1.
You should get regexq.pl's source code as the output to stderr. This quine is similar to MJD's /tmp/p quine.

japh2.pl

Second obfuscation, slightly better. There are no literals, no numbers or strings; everything is obtained from system variables.

#!/usr/bin/perl -- 07/29/2000
$#=($=/$=).($=/$=);$#=~/(\d)/;$_=$#-$+;++$|;undef $:;$:.=#-/
chr(($=/($#-$|)+$+)*($#-$|)+$|+$++$++$|);--$\;$:.=chr$+.$|.(
$=/$_)+$|;$.++;$:.=chr$#.$=/$_-$+;$:.=chr$#.$=/$_;++$.;$:.=#
chr$.+$+.$.;$%=$.+$+;$:.=chr$=/$_.$=/$_-$+;++$\;$:.=chr$#.$\
;$:.=chr$+x$%;$:.=chr$#.$=/$_;$:.=chr$+.$\.$%+$+;$.-=$.;$:.=
chr$+.$..$+;$:.=chr$#.++$%;$:.=chr--$%.$%-$+;$:.=chr$=+$=/$%
;$:.=chr$+.$\.$+;$:.=chr$#.++$%;$:.=chr$+.$\.($=/$_)+$%-$+-#
$+;$.=$%;--$.;$:.=chr$..$.-$+;$,=$%+$%+$+;$:.=chr$=+$_+$.-$+
;$:.=chr$,.$,-$+-$+;$:.=chr$,x($.-$+);$:.=chr$+.$\.($,-$++$+
)-$+-$+;$:.=chr$+.$\.$+;$:.=chr$#.$%;$:.=chr$++$+-$,/$%*$$*#
+$#;$_=$:;print(substr$:,$.-$.,length($_)-$+);

japh.pl

One of my first obfuscations. Not very good.

#!/usr/bin/perl -- 07/28/2000
$_=0x4A;$*=$|+=1;[email protected]_,$_;[email protected]_,$*;[email protected]_,$|;undef$_;$_+=$_[0];sqrt;#*
oct;$_=hex;[email protected]_,$_;$_[1]+=$_;undef$_;$_.='&';eval;[email protected]=~y/syntax //;
$,=3;$_=hex;[email protected]_,$_;$_=substr($_,$*);$_[$_]=$_[$_-$*]-$_;[email protected]_,$**#$*
hex(42);$_[$#_]--;[email protected]_,$_*hex(37);$_=$| x $,--;[email protected]_,$_;[email protected]_,$_[$,#
+$*];$_=$,++*hex($,--x$,);$_+=$|+$|;[email protected]_,$_;$_-=++$,;[email protected]_,$_;$_=$_#$
[--$,]-$*;[email protected]_,$_;$_=$,.($\-$\);$_=hex;[email protected]_,$_;substr($_,$\)=$,*$, +
$*;$_.=$\-$\;$_=hex;[email protected]_,$_;$_=$*.($\-$\);[email protected]_,$_[$_];[email protected]_,$_[++#*
$_];undef$_;$_+=hex($,*$,.($\-$\))+hex($,.($\-$\))+$,*$,*$,+$,*$,;[email protected]_
,$_;$_=(ord$\.'/')+$*;$_=hex$,.chr;[email protected]_,$_;$_=hex((hex)-$,);[email protected]_,$_;
$/=3+3;$_=hex($*+($/ . 0));[email protected]_,$_;$_=$_[($, . 0)-$*]+2;[email protected]_,$_;$_=#
$/.'b';$_=hex;[email protected]_,$_;$_=$_[$#_]-++$,*$,--;[email protected]_,$_;$_=$/+$*.$,;$_=+#
hex;[email protected]_,$_;map{print(chr)}@_;

Modified Sun Mar 25 08:48:47 2007 generated Sun Mar 25 08:56:33 2007
http://jeff.tk/perl/