http://qs321.pair.com?node_id=11123103


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"