"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
On Windows? It would require CR CR LF in the file (assuming default $/ and IO layers). Extremely unlikely. Elsewhere? It would require CR LF in the file (assuming default $/ and IO layers). Possible.
Well, that should be s{ \Q$/\E \z }{}xms (and /m and /s are useless) to be equivalent to the chomp. And if $/ hasn't been changed, s/\n\z// could be used (since $/ defaults to LF on all systems). But if I was going with a regex pattern, I'd go with s/\s+\z//. Handles \n, \r\n and other trailing whitespace. (TSV files being an exception.) In reply to Re^3: Perl::Critic says don't modify $_ in list functions and other things
by ikegami
|
|