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"
In Section
Seekers of Perl Wisdom