in reply to querybregarding array utils module in perl

If your files contain a single line with the array elements separated by commas then you will need to split the line, otherwise @array will contain just a single element ("1,2,3,4") and @array1 will also contain just a single element ("1,5,6,7"). Try reading the files in this way:
use strict; use warnings; use Array::Utils qw(:all); my $file = 'single.txt'; my $file1 = 'single1.txt'; my $fh; my @array; open($fh,"<",$file) or die("Could not open $file: $!"); while (my $line = <$fh>) { chomp $line; next unless $line; push(@array, split(',',$line) ); } close($fh); my @array1; open($fh,"<",$file1) or die("Could not open $file1: $!"); while (my $line = <$fh>) { chomp $line; next unless $line; push(@array1, split(',',$line) ); } close($fh);