http://www.perlmonks.org?node_id=175497


in reply to If statements with . and .. filehandles.

Or use the mighty regexp solution.
print "$file\n" if $file !~ /^\.{1,2}$/;

--
tune

Replies are listed 'Best First'.
Re: Re: If statements with . and .. filehandles.
by dsheroh (Monsignor) on Jun 18, 2002 at 23:49 UTC
    Correction:
    print "$file\n" if $file !~ /\A\.{1,2}\Z/;
    Using ^ and $ would also match files named .\n or ..\n.