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/ ); #### open FILE, 'test_file.txt' || die "$!\n"; while ( my $line = ) { die "File is not of UNIX format!\n" if ( $line =~ /\r\n/ ); last; } close FILE;