in reply to Printing a String (TOO stupid?)
Possibly the chomp-ed $line still has a carriage-return at the end of it.
c:\@Work\Perl\monks>perl -wMstrict -le "my $line = qq{01234567\x0d}; print qq{It was $line!!!\n}; " !!!was 01234567
This might arise if, e.g., the file had been created on a Windows system (with \x0d\x0a line-enders) and then transferred to a *nix system without proper newline translation. On the *nix system, chomp will take care of the \x0a but leave the \x0d untouched.
(BTW: It may or may not be too stupid, but the reason I know about this sort of thing is that I've done it myself — and more than once!)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing a String (TOO stupid?)
by locked_user jimson (Initiate) on Jun 18, 2014 at 07:12 UTC | |
by AnomalousMonk (Archbishop) on Jun 18, 2014 at 07:47 UTC | |
by Corion (Patriarch) on Jun 18, 2014 at 07:54 UTC | |
by Anonymous Monk on Jun 18, 2014 at 07:39 UTC | |
by RonW (Parson) on Jun 18, 2014 at 16:12 UTC | |
by Laurent_R (Canon) on Jun 18, 2014 at 18:46 UTC |