| Next | Tricks of the Wizards | 79 |
The easy way to do filtering is with Filter::Simple
We'll build a module that understands rot13-scrambled source code
Rot13:
abcdefghijklm nopqrstuvwxyz ABCDEFGHIJKLM NOPQRSTUVWXYZ
nopqrstuvwxyz abcdefghijklm NOPQRSTUVWXYZ ABCDEFGHIJKLM
Our test program looks like this:
use Rot13;
zl $f = "Uryyb, jbeyq\a";
$| = 1;
sbe (0 .. yratgu($f)) {
cevag fhofge($f, $_, 1);
fyrrc 1 vs enaq() < .5;
}
no Rot13;
print "All done!\n";
And in fact this works as written, and produces the output:
Hello, world
All done!
| Next | ![]() |
Copyright © 2003 M. J. Dominus |