in reply to Re^4: Trim Two Characters On Line
in thread Trim Two Characters On Line
Your $line usually has a Newline at the end, which will be one of the characters that you are trimming.
If you want the newline back, you have to add it back, e.g.$line =~ substr( $line, -2, 2, '' ) . "\n"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Trim Two Characters On Line
by AnomalousMonk (Archbishop) on Oct 23, 2020 at 22:18 UTC |
In Section
Seekers of Perl Wisdom