Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm writing a quick script which accepts files on the command-line (ARGV), and processes them. I want to check if a 'file' is actually directory ('-d $filename') - and if it's a directory, 'recurse' through that directory tree, and 'push' all the files in the directory onto the end of @ARGV. Some questions:<>
1) How would I recurse through the directory tree? How do I specify I only want '.mp3' files, or '.pl' files? 2) Is it safe to alter a scalar array in the middle of a 'foreach' loop? For example: foreach $word (@WORDS) { In reply to recurse directories? by Anonymous Monk
|
|