Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It's narrower than that: the only situation where it is reasonable to use chomp() is where:
1) the format of the records is delimited rather than fixed width. 2) the absence of a trailing line terminator on the last line is permissible; usually because the file has been manually created. 3) the only whitespace permitted at the end of the line is the carriage return - otherwise you wouldn't do it, you'd pattern-match. (Update: I mean of course to say: where all three conditions apply rather than just a subset of them) Such conditions are clearly exceptional rather than the rule, yet replies to this thread confirm my suspicion that people tend to assume their use of chomp() can be assumed as being in response to a "normal" textfile case.
__________________________________________________________________________________
^M Free your mind! In reply to Re^6: chop vs chomp
by Moron
|
|