Shawn Sharp wrote:
> I created the following code to search for extention .PBD files in the
> htdocs/PBD folder while using the apache webserver.  However it will only
> search in the cgi-bin folder for these files.  What am I doing wrong?

If you're just searching for files, this is probably a great opportunity to
use the File::Find module.  I reinvented the wheel about four times before I
discovered this one...d'oh!

oh yeah,        perldoc Find::File


try this:

#!/usr/bin/perl -w
use File::Find;
use strict;
use warnings;           #HEY!  Do i need this with -w?  somebody tell me...

my $root = "C:/temp";   #directory to start from
my $ending = ".pbd";    #extension to search for 
my @files;              #our list of found files

#go look for it...
#pass our subroutine for processing each file and the root dir
find(\&gotIt, $root);  

#print our list all pretty like, with linebreaks
print join("\n",@files);

sub gotIt{
                push(@files,$File::Find::name) if (/$ending$/i);
}


-good luck.
pk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to