Hi All,
I'm trying to find a way to compare the files and folders contained within 2
separate directory structures to determine whether they are identical or not.
For this I tried using the File::Find module but got stuck at a certain point.
I looked online and in some books but couldnt find a way so I'm hoping you can
help me.
The code looks like as follows.
use File::Find;
.........
.........
my $dir1 = 'c:\perl';
my $dir2 = 'c:\temp\perl';
find (\&wanted, $dir1, $dir2);
sub wanted()
{
my @array;
push @array, $_; # <------- problem here. How can I create 2 arrays for
$dir1 and $dir2.
.....
.....
}
As you can see above, I've passed both directories as arguments but what this
does is that it creates a single array with both $dir1 and $dir2 contents. What
I'm looking for is a way to move the contents of $dir1 into @array1 and
contents of $dir2 into @array2.
Thank you very much in advance.
Ahmer