in reply to Re^2: Adding a dispatch table and getting "Variable $x will not stay shared" errors.
in thread Adding a dispatch table and getting "Variable $x will not stay shared" errors.

Ok, so you do want to descend into sub-directories. But File::Find doesn't easily let you stop searching when you've found your file, so you could either use something like File::Next, or wrap the call to find() in an eval {} block, and die when you've found the file. Something like:
eval { find(sub { ($foundfile = $File::Find::name) if $File::Find::name =~ $target; die "FoundFile" if $foundfile; }, $location) }; die $@ if $@ and $@ !~ /FoundFile/;
  • Comment on Re^3: Adding a dispatch table and getting "Variable $x will not stay shared" errors.
  • Download Code