good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: get list of files matching part of file nameby Athanasius (Archbishop) |
on Jul 11, 2012 at 13:29 UTC ( [id://981116]=note: print w/replies, xml ) | Need Help?? |
A couple of points: (1) In the foreach loop, $file contains a filename together with its path and extension. To extract just the name part, you need something like:
which uses the fileparse function from File::Basename to extract the filename, then removes the extension (if any). (2) print Dumper(@matches); will print each match on a separate line. You would probably be better off with something like this:
HTH, Athanasius <°(((>< contra mundum
In Section
Seekers of Perl Wisdom
|
|