i wish to compare 1 file with multiple files (in a folder)
@allfile - >> the paths for all files in a folder
but once i run the code below, it keep loop at print "comparing $masterfile with $file1";
if i delete the compare function it works well.
what's wrong? Thanks
@allfile - >> the paths for all files in a folder
but once i run the code below, it keep loop at print "comparing $masterfile with $file1";
if i delete the compare function it works well.
what's wrong? Thanks
Code:
use File::Compare;
foreach $file (@allfile) {
my $file1=$file;
$masterfile='c:\\ts\\compare1.pl';
print "comparing $masterfile with $file1";
if (compare("$masterfile","$file1") == 0) {
print "They're equal\n";
} else {
print "They're not equal\n";
}
}
Comment