Although I didn't make it to the pub after Damian's talk I did hear from my
sources that someone thought it would be 'useful' to convert Bleach.pm to
print pony instead.  So here it is Pony.pm, it isn't quite the same as
Bleach but it produces a similar result.

Enjoy,

Matt

package Pony; 
$VERSION = '1.00';             # MSR - 28 Feb 2001
$magic = "pony " x 4;
sub pony { local $_ = unpack("b*", pop); s/0/ /g; s/1/pony/g; $magic.$_ }
sub depony { local $_ = pop; s/^$magic//; s/pony/1/g; s/ /0/g; pack("b*",
$_) }
open 0 or die;
($script = join("", <0>)) =~ s/^(.*^use\s+Pony\s*;\s*?\n)//sm;
$header = $1;
do { eval depony($script); exit } if ($script =~ /^$magic/);
open(0, ">$0") or die;
print {0} $header.pony($script);



Reply via email to