in reply to Hidden Newline in Result
You are using the Switch module, which can cause weird situations due to its code rewriting nature.
As a first step, have you tried rewriting your code without use of the Switch module?
As a second step, remove parts of your code until the problem disappears. Most likely, the part you removed contains a part of the problem. You have posted far too much code and far too little input data for us to properly attempt to reproduce your problem. See SSCCE for what helps us help you better.
Note that you are using chomp:
chomp($line);
This will not remove any ^M characters from the end of $line.
Most likely, you want to remove all whitespace from the end of the line instead, or all "newline-ish characters":
$line =~ s![\r\n]+$!!; # just newlines $line =~ s!\s+$!!; # all kinds of whitespace
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hidden Newline in Result
by phamalda (Novice) on Mar 05, 2017 at 19:12 UTC |