in reply to Recursive directory scanning
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 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
As usual
by pwhysall (Acolyte) on Mar 01, 2001 at 19:15 UTC | |
by merlyn (Sage) on Mar 01, 2001 at 19:26 UTC | |
by merlyn (Sage) on Mar 01, 2001 at 19:37 UTC | |
by chipmunk (Parson) on Mar 01, 2001 at 19:43 UTC | |
by Tyke (Pilgrim) on Mar 01, 2001 at 19:49 UTC | |
by merlyn (Sage) on Mar 01, 2001 at 21:49 UTC | |
by Tyke (Pilgrim) on Mar 02, 2001 at 13:38 UTC |