use File::Find;
$fullpath = `find $path/*/$file \;`;
where * is the day. Thanks for your help.
| [reply] [d/l] |
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
# the dir you're 'find'ing from
my $dir = shift || '.';
# the file you're looking for
my $file = 'blah';
# the results you want
my @results;
# the function you perform on each find value
sub looking_for_file
{
# push full filename to an array if file and name is $file
push(@results, $File::Find::name) if(-f $_ && $_ eq $file);
};
# the result you want, using File::Find::find()
# (not the external 'find' program)
find \&looking_for_file, $dir;
# print your results
print("my results are: @results\n");
In this example, you get an array (@array) with the values of each file found named 'blah'. unlike also, this should run on just about any platform.
I know my example was a bit lengthy, so here's a shorter version:
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
# the shorter version
my @results;
find sub{-f $_ && $_ eq 'blah' &&
push(@results,$File::Find::name)}, shift || '.';
print("my results are: @results\n");
~Particle | [reply] [d/l] [select] |