rsriram has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am working in Win32 and I want to get the list of file names under the current folder. There will be folders/files within it, folders/sub-folders/files within it. I used the opendir command as follows.
opendir(DIR, $isbn) or print "Can't open $isbn: $! No such job found!" +; my @contents = grep /(.+?)/, readdir DIR; foreach $file ( @contents ) {print "$file\n";}
But, with this, I get a display of only the folders and not the files/sub-folders under it. I want to get the list of all the files which are present within subfolders in the particular folder. Can anyone help me with the code for this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Listing of files in its sub-folders
by GrandFather (Saint) on Aug 31, 2006 at 10:04 UTC | |
|
Re: Listing of files in its sub-folders
by shmem (Chancellor) on Aug 31, 2006 at 10:09 UTC |