in reply to Re: special directory entries
in thread special directory entries

my @entries = grep { /^\.+$/ } readdir(DH);
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:
# Everything that isn't just dots. my @e = grep { ! /^\.+$/ } readdir(DH);
Because then your explanation matches your code. Or maybe even:
# Everything that doesn't begin with . or .. (better!) my @e = grep { ! /^\.\.?$/ } readdir(DH);
Because this would then eliminate "..." as a "system directory entry." (... is great for hiding things)

Replies are listed 'Best First'.
Re: Re: Re: special directory entries
by rob_au (Abbot) on Dec 04, 2001 at 03:10 UTC
    You are correct ... I had meant to write ...

    my @entries = grep { ! /^\.+$/ } readdir(DH);

    That's what you get for coding before the morning coffee ... Thanks clintp++

     

    perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'