open FILE, 'test_file.txt' || die "$!\n"; my $text = join( '', @{ [ ] } ); close FILE; die "The file supplied is not of unix format!\n" if ( $text =~ /\r\n/ );