But the error occurs when file 1 contains one line and file 2 contains 2 lines.use strict; use warnings; open (FILE, "a") or die "Unable to open ref file.\n"; my @data1 =<FILE> ; close(FILE); open (FILE, "b") or die "Unable to open new file.\n"; my @data2 =<FILE> ; close(FILE); my $i; for( $i = 0; $i < 2; $i++){ if ($data1[$i] ne $data2[$i]){ print "Mismatch for $data1[$i] and $data2[$i]\n"; exit; } }
In reply to Re^4: Perl delete function
by annel
in thread Perl delete function
by annel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |