display | more...
Here is a generic text conditioner for use when putting hairy documents, such as source code into everything. Enjoy:
#!/usr/bin/perl
##########################################################
# 
# txt2e v1.3 - text conditioner for everything
# "Now, with 100% more Perl Power!"
# by Jason H. Reeves - <jhr@net-noise.com>
# Released/Created: 6-19-2000
# License: GPL
#
##########################################################

print "<PRE>\n";
while(<>)
{
        s/&/&amp;/g;
        s/\[/&#91;/g;
        s/\]/&#93;/g; 
        s/</&lt;/g;
        s/>/&gt;/g;
        print "$_";
}

print "</PRE>\n";
##Shameless plug. :-)
print "Processed by [text conditioner for everything|txt2e] written by [jhr]\n";
Processed by txt2e written by jhr

See also: bash, Perl, spaghetti code, existential blues

Log in or register to write something here or to contact authors.