V
vdvorkin
I must pass through directory tree and to execute some action with
files, names of which described by regex. I need not do it in
directories SCCS and VVS, which can be in every subdirectory.
The following code works correctly, does not action ("THE ACTION") in
unwanted directories, but it pass through every subdirectory. I'd
would like that it will worked faster, and procedure "wanted" will not
step inside SCCS and VVS. I have tried for that purpose the
"untaint_pattern" and "untaint_skip" options but did not success.
Perhaps I used incorrect values. Or, I do not understand the task of
the options correctly.
Somebody can suggest to me the decision?
Thanks in advance,
--Vadim
use File::Find;
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
sub wanted;
# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '.');
sub wanted { # $_ is file name
if ($dir !~ /\/SCCS\b/ && $dir !~ /\/VVS\b/)
{
THE ACTION...
}
}
files, names of which described by regex. I need not do it in
directories SCCS and VVS, which can be in every subdirectory.
The following code works correctly, does not action ("THE ACTION") in
unwanted directories, but it pass through every subdirectory. I'd
would like that it will worked faster, and procedure "wanted" will not
step inside SCCS and VVS. I have tried for that purpose the
"untaint_pattern" and "untaint_skip" options but did not success.
Perhaps I used incorrect values. Or, I do not understand the task of
the options correctly.
Somebody can suggest to me the decision?
Thanks in advance,
--Vadim
use File::Find;
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
sub wanted;
# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '.');
sub wanted { # $_ is file name
if ($dir !~ /\/SCCS\b/ && $dir !~ /\/VVS\b/)
{
THE ACTION...
}
}