Obfuscated Perl

morse.pl

Morse code JAPH.

#!/usr/bin/perl -- 07/29/2000
# Just      .--- ..- ... -
# another   .- -. --- - .... . .-.
# Perl      .--. . .-. .-..
# hacker    .... .- -.-. -.- . .-.
$____=@____=split//,'';
$___=@___=split//,'hlrou';
$__=@__=split//,'aPent';
$/=@.=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;push@_,$_;push@_,$*;push@_,$|;undef$_;$_+=$_[0];sqrt;#*
oct;$_=hex;push@_,$_;$_[1]+=$_;undef$_;$_.='&';eval;$_=+$@=~y/syntax //;
$,=3;$_=hex;push@_,$_;$_=substr($_,$*);$_[$_]=$_[$_-$*]-$_;push@_,$**#$*
hex(42);$_[$#_]--;push@_,$_*hex(37);$_=$| x $,--;push@_,$_;push@_,$_[$,#
+$*];$_=$,++*hex($,--x$,);$_+=$|+$|;push@_,$_;$_-=++$,;push@_,$_;$_=$_#$
[--$,]-$*;push@_,$_;$_=$,.($\-$\);$_=hex;push@_,$_;substr($_,$\)=$,*$, +
$*;$_.=$\-$\;$_=hex;push@_,$_;$_=$*.($\-$\);push@_,$_[$_];push@_,$_[++#*
$_];undef$_;$_+=hex($,*$,.($\-$\))+hex($,.($\-$\))+$,*$,*$,+$,*$,;push@_
,$_;$_=(ord$\.'/')+$*;$_=hex$,.chr;push@_,$_;$_=hex((hex)-$,);push@_,$_;
$/=3+3;$_=hex($*+($/ . 0));push@_,$_;$_=$_[($, . 0)-$*]+2;push@_,$_;$_=#
$/.'b';$_=hex;push@_,$_;$_=$_[$#_]-++$,*$,--;push@_,$_;$_=$/+$*.$,;$_=+#
hex;push@_,$_;map{print(chr)}@_;

Valid HTML 4.0?

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