I have code like below. If I open the file $File::Find::name (in this case it is ./tmp/tmp.h) in my search function (called by File::Find::find), it says "cannot open the file ./tmp/tmp.h reason = No such file or directory at temp.pl line 36, line 98."
If I open the file directly in another fuction function, I am able open the file.
C...
I am using File::Find in the code below to find the files from /home/user/data path.
use File::Find;
my $path = "/home/user/data";
chdir($path);
my @files;
find(\&d, "$path");
foreach my $file (@files) {
print "$file\n";
}
sub d {
-f and -r and push @files, $File::Find::name;
}
As I am changing the dir path to the path from where...
I have a folder named Lib and I am using the File::Find module to search that folder in whole dir say, D:\. It's taking a long time to search, say even 5 mins if the drive has a lot of subdirectories. How can I search that Lib faster so it will be done in seconds?
My code looks like this:
find( \&Lib_files, $dir);
sub Lib_files...
Using File::Find, how can I pass parameters to the function that processes each file?
I have a Perl script that traverses directories in order to convert some 3-channel TIFF files to JPEG files (3 JPEG files per TIFF file). This works, but I would like to pass some parameters to the function that processes each file (short of using glo...
Possible Duplicate:
How do I pass parameters to the File::Find subroutine that processes each file?
One can use Perl's File::Find module
like this:
find(\&wanted, @directories);
How can we add a parameter to the wanted function?
for example i want to traverse the files in /tmp extracting some information from each file ...