Following on from
Tick-tock, the following obfuscated code has been tested to execute cleanly on both Linux and Windows - This code differs markedly from my previous obfuscation in that the code below is also a self-modifying quine, albeit, this quine behaviour is achieved through performing a
seek on the
DATA file handle.
I am considering my obfuscation fix now thoroughly purged! :-)
#!/usr/bin/perl
' ....... ';
' .. .. '||print"Tick-Tock 2, a self-modifying quine";
' .. .. '&&seek+DATA,!++$|,0;@ot=<DATA>;for($[..$#ot){
' . . '&&($ot[$_]=~/^[^']/)&&next;$c=substr($ot[$_],
' . . '+1,22);$c=~s/[^\.\s]/ /g;substr($ot[$_],1,22+
' . . ',$c)};for(0..359){$c[$_]=[cos(atan2(1,1)/45*(
' . . '+$_-90)),sin(atan2(1,1)/45*($_-90))]};@time=(
' . . ',localtime)[2,3];$o=join'',@ot;$l=0;for($[..(
' . . '+10)){$l+=length($ot[$_])+1};$l++;for(1..((9+
' . . '))){substr($o,$l+int($_*$c[($time[0]*6)][1]*(
' . . '+1))*71+int($_*$c[$time[0]*6]->[0]),1,'m');};
' . . ';for(1..4){substr($o,$l+int($_*$c[($time[1+((
' . . '))]%12)+($time[0]/60)*30][1])*71+int($_*$c[0+
' . . '+(($time[1]%12)+$time[0]/60)*30][0]),1,'h');;
' . . ';};sub rnd{$v=CORE::int$_[0]*10**$_[1]+.5;1&&
' . . ';$v=~s;(.{$_[1]})$;\.$1;;(substr($v,0x0-1+(((
' . . '))))eq'.')&&do{chop$v};$v};END{((defined$o)&(
' . . '||1));print$o;sleep(30);eval$o};sub int{0x1&&
' .. .. ';rnd(shift,0)};BEGIN{$s=($^O=~/MSWin/i)?do{1&
' .. .. ';'cls'}:('clear');system($s)};
' ....... ';
__DATA__
perl -le 'print+unpack("N",pack("B32","00000000000000000000001000101000"))'