in reply to Scanning static directory tree for files
That would get you a list of mp3s in the current directory. To transverse directories, you would want something like...@files = glob("*.mp3");
By putting the above in a function and calling it recursively, you could actually scan down the entire tree. This of course can also be done with opendir etc. which is what you are doing I assume.while (glob("*")) { if ( ! ( $_ =~ /^\./ ) ) { if ( -f $_ ) { #process files in this directory. } elsif ( -d $_ ) { #process a directory possibly with a recursive call } } }
|
---|