Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
it corrupts the html in $line. Any ideas? Thanks.sub convert { my $in = shift; return ( '&#' . ord($in) . ';'); } $line =~ s/([\&\'\;\\\"\|\*\?\~\^\(\)\[\]\{\}\$\n\r\<\>])/&con +vert($1)/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: preserving html in patterns
by jeffa (Bishop) on Dec 21, 2001 at 06:31 UTC | |
|
Re: preserving html in patterns
by davorg (Chancellor) on Dec 21, 2001 at 14:04 UTC | |
by hacker (Priest) on Dec 21, 2001 at 15:52 UTC | |
|
Re: preserving html in patterns
by mrbbking (Hermit) on Dec 21, 2001 at 06:39 UTC |