in reply to the chomp does not seem to work

I can reproduce the behaviour on my linux box using windows format text files, that is lines end with "\r\n". It works as expected when the line endings are just "\n" on linux

Replies are listed 'Best First'.
Re^2: the chomp does not seem to work
by Skeeve (Parson) on Mar 11, 2008 at 12:35 UTC

    That's why I usually use $line=~tr/\015\012//d.

    This removes any CR and LF from $line. It works fine as long as you don't care for empty lines.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e