Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: escaping anallowed chars for browser

by dingus (Friar)
on Nov 19, 2002 at 16:10 UTC ( #214168=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://214168]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-03-31 03:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (179 votes). Check out past polls.

    Notices?