in reply to File:Find DIR search sub routine query

I havn't tested this with your particular code, but I remember having a similar problem, and it was solved like this, by adding some explicit returns:
# 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.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

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

    Thanks for responding, I tried what you said but it still didn't work for me. I'll continue to fiddle and see if I can find a working solution.