in reply to Re: Chomp doesn't seem to work
in thread Chomp doesn't seem to work
If I'm stripping a single line thing, I'd use \z to anchor to the end of the string.
Similarly, the \n and \r are semantic, referring to this platform's idea of newlines and returns. Specify exact encodings that you're encountering. For sources using ASCII or UTF-8, that's probably \x0A and \x0D.
$text =~ s/[\x0D\x0A]+\z//;
--
[ e d @ h a l l e y . c c ]
|
|---|