svsingh has asked for the wisdom of the Perl Monks concerning the following question:
Here's the code so far...
use strict; use File::Find; use Cwd; # BEGIN MAIN $, = "\n"; print &getFileList; # END MAIN sub getFileList { my @fileList = (); # list for matching files find(\&findFilter, "."); # populates the list return @fileList; sub findFilter { if ( /\.hhc$/ ) { # only push matching filenames my $curDir = cwd; my $fileName = $curDir . $_; push @fileList, $fileName; } return; } }
Here are my questions and issues:
I had to do a lot of digging to get enough information to get this far and really appreciate any help you can offer. I'm also hoping this can serve as a useful example in case anyone else is trying to do the same thing. For example, this can also be a good way to create an MP3 playlist.
Thanks for your help everyone.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using File::Find to Create a List of Files
by broquaint (Abbot) on May 16, 2003 at 16:08 UTC | |
by svsingh (Priest) on May 16, 2003 at 16:18 UTC | |
|
Re: Using File::Find to Create a List of Files
by grantm (Parson) on May 16, 2003 at 20:36 UTC | |
|
Re: Using File::Find to Create a List of Files
by freddo411 (Chaplain) on May 16, 2003 at 16:58 UTC |