in reply to File:Find DIR search sub routine query
# instead of your if, split it up into 2 lines # return unless -d; # $File::Find::prune = 1 if /[LP]\d{8}$/; # Don't recurse. # print "$File::Find::dir/$_/\n" if /[LP]\d{8}$/; return unless -d; return unless $_ =~ /[LP]\d{8}$/; $File::Find::prune = 1; # don't descend print "$File::Find::dir\n"; print "$file::Find::name\n"; # or possibly better return $File::Find::prune = 1 if /[LP]\d{8}$/; # Don't recurse.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File:Find DIR search sub routine query
by PerlPlay (Novice) on May 29, 2014 at 07:39 UTC |