S
solaristar
i had this working with close(DIR); but im trying to do some best
practices code here and apparently closedir is more what i should be
using
here's the relevant code snippet
opendir(my $dh, $basedir) || die "can't open $basedir: $!\n";
my $suff_re = qr/\.[mcu]w\./;
my @servers = grep { !/^\./ && m/$suff_re/ } readdir($dh);
...
...
closedir($dh);
the error
closedir() attempted on invalid dirhandle $dh at ./foo20 line 48.
closedir() attempted on invalid dirhandle $dh at ./foo20 line 48.
line 48 is closedir($dh);
thoughts?
practices code here and apparently closedir is more what i should be
using
here's the relevant code snippet
opendir(my $dh, $basedir) || die "can't open $basedir: $!\n";
my $suff_re = qr/\.[mcu]w\./;
my @servers = grep { !/^\./ && m/$suff_re/ } readdir($dh);
...
...
closedir($dh);
the error
closedir() attempted on invalid dirhandle $dh at ./foo20 line 48.
closedir() attempted on invalid dirhandle $dh at ./foo20 line 48.
line 48 is closedir($dh);
thoughts?