use IO::File; my $io_file1 = IO::File->new( $file1, 'r' ); my $io_file2 = IO::File->new( $file2, 'r' ); $io_file1->binmode( ':crlf' ); $io_file2->binmode( ':crlf' ); my $diff = diff( $io_file1, $io_file2, { STYLE => "OldStyle", CONTEXT => "0" });