Shawn Sharp wrote:
Can someone help on this one?

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?

#!/perl/bin/perl

use warnings;
use strict;
use CGI qw( :standard );

my $root = qq{c:/Program Files/Apache Group/Apache2/htdocs/PBD/};
opendir (DIRHANDLE, "$root");
my $glob = "*.PBD*";
my @files = glob($glob);
my $files = @files;
closedir (DIRHANDLE);


You are misusing the opendir/glob functions. In general they are not used together. Either you want to use the glob, or do the opendir. The glob does not act on the open directory handle. If you use the opendir, then you get the list of files by using a 'readdir'. The following should help:


perldoc -f opendir
perldoc -f readdir
perldoc -f glob

http://danconia.org


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



Reply via email to