TheMarty has asked for the wisdom of the Perl Monks concerning the following question:
I tried to use File::Finder->name($file)->in(@directories) but this gives me only 1 or 0 (if file is there or not). Of course, when I have this big @allfiles list, I can use foreach and go through and check which one is it, but I hoped if there is already wrapper for File::Find, it should have such search type somehow build in. Greetings TheMartysub FindFile { my $file = shift(@_); my @directories = @_; my $pathtofile; my @allfiles; unshift(@directories,"./"); @allfiles = File::Finder->in(@directories); return $pathtofile; };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: File::Finder usage
by bpphillips (Friar) on Oct 29, 2004 at 12:46 UTC | |
by merlyn (Sage) on Oct 29, 2004 at 13:27 UTC | |
by tye (Sage) on Oct 29, 2004 at 16:21 UTC | |
Re: File::Finder usage
by pg (Canon) on Oct 29, 2004 at 16:48 UTC |