Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: chomp() problemsby charnos (Friar) |
on Sep 24, 2002 at 17:52 UTC ( [id://200443]=note: print w/replies, xml ) | Need Help?? |
$line =~ tr/\r\n//d; should do what BrowserUK suggested..IIRC, the /d is required to delete characters. Checking the value of $/ would help ascertain why chomp() isn't working the way you expected. Also, $line =~ s/\r\n$//; would probably more accurately replicate chomp()'s functionality. Update: Thanks to bart, who reminded me that the $INPUT_RECORD_SEPARATOR is $/, not $\. There still appear to be quite a few incorrect vars floating around this thread.
In Section
Seekers of Perl Wisdom
|
|