my $bad = {
'&' => '&',
'|' => '&pipe;', # I don't know this one :-)
';' => ';', # This one either
};
my $find = join '', keys %{$bad};
$string =~ s/([$find])/$bad->{$1}/g;
Enjoy
-- Casey
In reply to Re: Safer (and cleaner) way to print user-supplied text.
by cwest
in thread Safer (and cleaner) way to print user-supplied text.
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |