in reply to Search a perl reference and replace characters
Further more the input listed is in:
my $text = "above"
Huh?
Do you wish to convert 'newlines', or 'carriage returns'? My guess is probably newlines. If that's the case, you may be looking for something like this:
$input =~ s{\n}{</p&rt;<p&tk;}gOr maybe you really do mean carriage returns, in which case it would be:
$input =~ s{\r}{</p&rt;<p&tk;}gYour entities look funny to me though, but that's a different issue.
Regular expressions, including 'substitutions' are covered in perlre, perlrequick, and perlretut. Those documents will go a long way toward clearing the haze regarding string manipulation and pattern matching in Perl. They're well worth the time they take to read.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search a perl reference and replace characters
by ww (Archbishop) on Jun 02, 2006 at 18:06 UTC | |
|
Re^2: Search a perl reference and replace characters
by Anonymous Monk on Jun 02, 2006 at 13:22 UTC |