in reply to neat little win32 freeware utility

Here is a very short Perl snippet that does Text (including code) to HTML. It will also escape the [ and ] for you so is PM HTML compatible!

my $text = "c:/text.pl"; open TEXT, $text or die "Oops can't open $text $!"; open HTML, ">$text.htm" or die "Oops can't write $text.htm $!"; print HTML "<pre>\n"; while (<TEXT>) { $_ = escapeHTML($_); print HTML $_; } print HTML "</pre>\n"; close HTML; close TEXT; sub escapeHTML { local $_ = shift; # make the required escapes s/&/&amp/g; s/"/&quot;/g; s/</&lt;/g; s/>/&gt;/g; # change tabs to 4 spaces s/\t/ /g; # make the whitespace escapes - not required within <pre> tags s/( {2,})/"&nbsp;" x length $1/eg; # make the brower bugfix escapes; s/\x8b/&#139;/g; s/\x9b/&#155;/g; # make the PERL MONKS escapes (if desired) s/\[/&#091;/g; s/\]/&#093;/g; # change newlines to <br> if desired - not required with <pre> # s/\n/<br>\n/g; return $_; }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print