listing files in sub directories

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to list all files in all sub-directories and have the code
below but this is listing the . directories as well as the directories
themselves. I just want the full path filenames and not the individual
directories out. Here is what I have


@ARGV = qw(.) unless @ARGV;

use File::Find;

find sub { print $File::Find::name, -d && "/", "\n"}, @ARGV

for example if structure is

the output of the script when run from c:\ would be

all I want is


Re: listing files in sub directories

Quoted text here. Click to load it

Err... you already seem to know the answer to that...

    find sub { -d or print "$File::Find::name\n" }, @ARGV;


Site Timeline