To examplify this, I also thought I'd better need some spiraling code, so this code will search a directory recursively, searching all files for a POD =head\d entry NAME or TITLE (case insensetive). If found, it will print the path and the NAME/TITLE of the file. Try it on your /usr/lib directory, or wherever perl has it's modules installed on your computer. The program takes the directory as a commandline parameter or defaults to the current directory. You must have File::Find installed, though.
The part before __END__ is the (obfuscated, of course) parser, that decodes and executes the spiraling code, which is of course after __END__. You can read it by finding the middle letter in both axis, then going first to the right, then down, then left, up, etc...
#!/usr/bin/perl -w use strict;#:-) @!=<DATA>;chomp @!;$_=@!;map{$_ =[split//]}@!;$ 0=1;$a=$b=int$_ /2;my$s=sub{for (0..$!){push@0, $![$a][$b]|| 0; ${$_[0]}+=$0;}} ;while($!<$_){& $s(\$b);&$s(\$a );$!++;$0=-$0;} eval join'',@0; __END__ }}close FILE;} ;_\n";last;}els 1$t && /\S/){pi "x; open(FILrf =tetub wnt{rEi( nnxs\&wnt,e,n/ ti$e;(le:: t t= xr(n)diusFsu$ h epf$'nF eihr_"e n;i .if;dnin)$a $"{y' || tf ;Fd {n)m ;)d-(fiwi\ )\>ELIF<(elihld ieman::dniF::e\ /)ELTIT|EMAN(+s
But wait! I am not finished yet. Maybe you would like to create your own spiraling code? Then you can use the following spirali(zi)ng code...
The silly example should produce this:#!/usr/bin/perl -w my $code = q($_="Put your code here, please!!\n"; print; exit;); use strict;#:-) @!=<DATA>;chomp @!;$_=@!;map{$_ =[split//]}@!;$ 0=1;$a=$b=int$_ /2;my$s=sub{for (0..$!){push@0, $![$a][$b]|| 0; ${$_[0]}+=$0;}} ;while($!<$_){& $s(\$b);&$s(\$a );$!++;$0=-$0;} eval join'',@0; __END__ ][$i];}print"\n";} _1);$a+=$0;}$!++;$0 $,+=$0;}last if($c= [+be($c<$l){for(0>- F+$l.";die;}my@F.=$ $c;ite must be ;.$0 t$)h'd=int($wham$l; n,1wno!my$wh=) y!)} ie,;sch;lengs)r$);f rd+)i w)=mytq{oc{fo po+2 f$el$ hrpo=$or {cc/"o(doc$(trt0Fr( )$$h. fi;)l$(i ;[(0 +(,w htgneL"tnn$$0. +re$l$." ,rebmu0a.. itd(tni=b$=a$;1=].$ $soc$(rtsbus=]b$[$# ;bus=]b$[]a$[F${)!F hw$<i$;0=i$ym(rof{)
and when run with the parser, print a message before it exits. Yep, very contrived. :); exit; tre, pl net yoe ihu$_ua r P"=rs pedoc e ;"n\!!
Tips: If something seems to not work, you can add the classic ... or die "$@"; to the last line of the parser, the one with the eval. If something went wrong with the execution of your code, this will show something. Not that it most likely will help much, in this case...
This was all I had for today, and I hope someone will like it. :)
You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.
|
---|