H
Hobo Salesman
Quoted from File::Find POD:
"processFile()" is "The wanted function". Some code from my program:
find( {
wanted => \&processFile,
preprocess => \&processDirectory,
no_chdir => 1,
}, $self->{"rootPath"});
I have what's above in a "site" object, and I want to pass that object
to processFile(), which is called by File::Find. "processFile()" needs
to create a "file" object that has to know a few things from the "site"
object, most importantly which site it's part of. I'm a little stumped
as to the best way to make that data accessable to the file object.
This doesn't work:
wanted => \&processFile($self->{"siteName"}),
Or rather, it does pass the data I need, but in the process it makes
the data File::Find provides ($File::Find::name, etc) innaccesable. Any
suggestions would be appreciated. Thanks,
HS
use File::Find;
find(\&wanted, @directories_to_search);
The wanted function takes no arguments but rather does its work through a collection of variables.
"processFile()" is "The wanted function". Some code from my program:
find( {
wanted => \&processFile,
preprocess => \&processDirectory,
no_chdir => 1,
}, $self->{"rootPath"});
I have what's above in a "site" object, and I want to pass that object
to processFile(), which is called by File::Find. "processFile()" needs
to create a "file" object that has to know a few things from the "site"
object, most importantly which site it's part of. I'm a little stumped
as to the best way to make that data accessable to the file object.
This doesn't work:
wanted => \&processFile($self->{"siteName"}),
Or rather, it does pass the data I need, but in the process it makes
the data File::Find provides ($File::Find::name, etc) innaccesable. Any
suggestions would be appreciated. Thanks,
HS