http://www.perlmonks.org?node_id=214168


in reply to escaping anallowed chars for browser

From a node I can't find on perlmonks comes this handy trick:
my %entity = ( '<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;', ); $output =~ s/([<>&"])/$entity{$1}/g; print $output;
I use it all the time for debug output

Dingus


Enter any 47-digit prime number to continue.