Don't ask to ask, just ask | |
PerlMonks |
Re: filtering file names to be added to an array...maybe.by myocom (Deacon) |
on Jun 06, 2001 at 09:06 UTC ( [id://86121]=note: print w/replies, xml ) | Need Help?? |
You're on the right track. Rather than using the readdir bit, try using glob, as follows:
Excellent job with the -w on the #! line! You should also add use strict; just under that. This will force you to declare your variables, among other things, so that's why my code snippet above uses my. Chatterbox-inspired clarification: You can feed glob a path as part of its argument, like my @files = glob('/temp/*.dat'); Otherwise, glob acts on the current working directory.
In Section
Seekers of Perl Wisdom
|
|