Hi. Anyone got any ideas why 'readdir' doesn't seem to be working for mein this code? Probably missed something really simple... but its driving me mad :(
my $dir = 'C:/Inetpub/wwwroot/accreditation/domain.com/cgi-bin/data';
open DIR, $dir || die $!;
# read all but '.' and '..'
my @dir_contents = grep /[^.]/, readdir DIR;
closedir DIR;
foreach (@dir_contents) {
print "File: $_ <BR>";
}
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
print $IN->header(); my $dir = 'C:/Inetpub/wwwroot/accreditation/domain.com/cgi-bin/data';
open DIR, $dir || die $!;
# read all but '.' and '..'
my @dir_contents = grep /[^.]/, readdir DIR;
closedir DIR;
foreach (@dir_contents) {
print "File: $_ <BR>";
}
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!