- or download this
my $dirname = '.';
opendir(DIR, $dirname) or die "can't opendir $dirname: $!";
while (defined($file = readdir(DIR))) {
if ($file ne '.' || $file ne '..'){print "$file\n";}
}
closedir(DIR);
- or download this
my $dirname = '.';
opendir(DIR, $dirname) or die "can't opendir $dirname: $!";
while (defined($file = readdir(DIR))) {
if ($file eq '.' || $file eq '..'){print "$file\n";}
}
closedir(DIR);
- or download this
opendir (DIR, ".") or die "$!";
@dir = grep !/^\.\.?$/, readdir DIR; closedir DIR;