#!/usr/bin/perl sub FileFinder { my ($target, @dir) = @_; return (grep {-e $_} map {"$_/$target"} @dir)[0]; } open(F, FileFinder('FileFinder.pl', qw(some/ dirs/ ./)) || die "File n +ot found") or die $!;
In reply to Re: Find a file in a list of directories
by asdfgroup
in thread Find a file in a list of directories
by grinder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |