in reply to Re: special directory entries
in thread special directory entries
Not to be too pedantic, but this code isn't particularly useful. It gives back all of the entries that consist only of dots (and, well, we know they're there!). I think you meant:my @entries = grep { /^\.+$/ } readdir(DH);
Because then your explanation matches your code. Or maybe even:# Everything that isn't just dots. my @e = grep { ! /^\.+$/ } readdir(DH);
Because this would then eliminate "..." as a "system directory entry." (... is great for hiding things)# Everything that doesn't begin with . or .. (better!) my @e = grep { ! /^\.\.?$/ } readdir(DH);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: special directory entries
by rob_au (Abbot) on Dec 04, 2001 at 03:10 UTC |