Gossamer Forum
Home : General : Perl Programming :

simple regex replace problem

Quote Reply
simple regex replace problem
hello,

i'm creating a script in dos that parses some HTML and the following code snippet will not work properly:

my $cr = chr(13).chr(10);
my $text =~ s/$cr/<br>/g;
print $text;

i am printing to the DOS console in this case and the \n\r characters do not get removed when printed out... as a matter of fact, this snippet of code nukes the whole string and i end up with an empty string....

thanks if anyone can help. :-)
Subject Author Views Date
Thread simple regex replace problem mozkill 4663 Jun 30, 2003, 2:36 PM
Thread Re: [mozkill] simple regex replace problem
Paul 4513 Jun 30, 2003, 2:42 PM
Thread Re: [Paul] simple regex replace problem
mozkill 4493 Jun 30, 2003, 3:00 PM
Post Re: [mozkill] simple regex replace problem
mozkill 4500 Jun 30, 2003, 3:06 PM