use strict; use warnings; use open IN => ':crlf', OUT => ':raw'; @ARGV = ( "test.txt" ); $^I = ".bak"; while( <> ) { print; }