in reply to chomp() problems
As `perldoc -f chomp` tells us, chomp <cite>removes any trailing string that corresponds to the current value of "$/"</cite>; so look at the value of $/. Because it's quite tricky how the "end of line" portability problem was solved (`man perlport`), i'd recommend you to use the explizit character escapes \015 and \012 instead of \r and \n:
--{ local $/="\015\012";chomp }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: chomp() problems (use \015\012)
by Flexx (Pilgrim) on Sep 24, 2002 at 23:38 UTC |