What you really want to do is to use File::Find. There are a lot of threads here, look with the Super Search functionality (try "find files").
There's nothing bad about File::Find - here's a short example that prints every filename (twice) :
#!/bin/perl -w use strict; use File::Find; my @directories = ('.'); find( sub { # This sub gets passed the current filename relative to # the directory file::find recurses into - this is # weird and leads to many a confusing error. # Instead, I use $File::Find::name, which always gives # the full path (relative to the directory you were # in when you started File::Find). my( $filename ) = @_; print $File::Find::name, "\n"; print $filename, "\n"; }, @directories );
In reply to Re: Recursive directory scanning
by Corion
in thread Recursive directory scanning
by pwhysall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |