The script which I have ran in windows with strawberry perl is not working in unix machine : <p>The script which I have ran in windows with strawberry perl is working and perfectly giving the results but the same script in unix/Linux machine is not working. Can any one help on this. In windows i am using perl 5.20.1 version and in Ubuntu i have perl 5.22.1 version. </p>

<p>Here is my code </p>

<pre><code>use strict;
use warnings;

my $fname = '/hadoop/user/Kishore/Temp1.txt';
open my $afile, "&lt;", $fname or die "Couldn't open $fname: $!";
my %a_lines;
my %b_lines;
my $count1=0;
while (my $line = &lt;$afile&gt;) {
    chop $line;
    $a_lines{$line} = undef;
    $count1=$count1+1;
}
print"File1 records count : $count1\n";

close $afile;
$fname = '/hadoop/user/Kishore/Temp2.txt';
my $OUTPUT = '/hadoop/user/Kishore/final_result.txt';
open my $bfile, "&lt;", $fname or die "Couldn't open $fname: $!";
open (OUTPUT, "&gt;$OUTPUT") or die "Cannot open $OUTPUT \n";
my $count=0;
my $count2=0;
while (my $line = &lt;$bfile&gt;) {
    chop $line;
    $b_lines{$line} = undef;
    $count2=$count2+1;
    next if exists $a_lines{$line};
    $count=$count+1;
    print OUTPUT "$line \t===&gt; The Line which is selected from file2/arg2 is mismatching/not available in file1\n";
}
print "File2 records count : $count2\n";
print "Total mismatching/unavailable records in file1 : $count\n";
close $bfile;
close OUTPUT;
</code></pre>
