in reply to chop vs chomp

I've never used chomp() or chop().

I usually put portability as one of my top priorities when I program. Thus, I fear mishandling of different end-of-line sequences. So I almost always use the following skeleton code:

while ( defined( my $line = <HANDLE> ) ) { $line =~ s/\s*[\n\r]*\Z//s; . . }