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; . . }
In reply to Re: chop vs chomp
by monarch
in thread chop vs chomp
by Moron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |