in reply to File::Find in a loop
I haven't tested it, but I guess you could simply pass a parameter to your wanted call-back function:
my @dir = ( qw( N:/TMP N:/TMP_2 )); for my $dir ( @dir) { find( \&wanted ($dir), $dir ); }
And modify the wanted function as follows:
sub wanted { my $dir = shift; print "[$dir] $File::Find::dir $File::Find::name\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File::Find in a loop
by 2teez (Vicar) on Apr 28, 2013 at 21:45 UTC | |
by Laurent_R (Canon) on Apr 28, 2013 at 22:27 UTC | |
by Anonymous Monk on Apr 28, 2013 at 22:55 UTC |