"Hi Ken I tried your example but it wouldn't output anything."
The technique I showed should work fine. In his response below, Athanasius has highlighted the issue with your original premise (i.e. parent vs. current directory). You can still use the technique I provided, you'll just need to work it into the code fix he's shown.
"If I removed the pattern match string it does work but I'm not sure what it is printing out - the directory listing seems random."
Hashes are unordered: keys %hash_name will return a list of keys in an apparently random order. If you're interested, see the "Hash Algorithm" section of "perlsec: Algorithmic Complexity Attacks" for more details.
sort may provide the ordering you want. If not, you may want to consider an array, or perhaps a more complex data structure, instead of a hash, to store your data. See "perldsc - Perl Data Structures Cookbook".
-- Ken
In reply to Re^5: File:Find pattern match question
by kcott
in thread File:Find pattern match question
by RockE
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |