The easy way using HTML::Entities:
use HTML::Entities; encode_entities( $some_var ); # or decode_entities( $some_var );
See the documentation for extra features.
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
In reply to Re: A quick regex to (imperfectly) entity encode some HTML?
by Ovid
in thread A quick regex to (imperfectly) entity encode some HTML?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |