Perhaps the value doesn't end in a newline, or perhaps someone changed $/. You can check what the values of $line and $/ using
use Data:::Dumper; { local $Data::Dumper::Useqq = 1; print(Dumper($var)); }
You might have better luck with the following:
It removes all forms of whitespace from the end of the line (except NBSP U+00A0 in some circumstances).$line =~ s/\s+\z//;
In reply to Re: chomp - reference
by ikegami
in thread chomp - reference
by michaelp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |