Hi,
Maybe I'm too stupid to understand the documentation, and maybe examples in the docu are so complex, and I need simple thing.
I'm trying to find some specific file using File::Finder.
Something like: myfile.txt
I do not know in which directory is that file. In case I find it, I'd like to get the full path to it. Other case - undef (or 0).
I managed to get the full list of all files with File::Finder
sub FindFile
{
my $file = shift(@_);
my @directories = @_;
my $pathtofile;
my @allfiles;
unshift(@directories,"./");
@allfiles = File::Finder->in(@directories);
return $pathtofile;
};
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
TheMarty