Don't ask to ask, just ask | |
PerlMonks |
Re: Re: Re: Create a list of directories without . and ..by dsheroh (Monsignor) |
on Jun 04, 2002 at 19:37 UTC ( [id://171615]=note: print w/replies, xml ) | Need Help?? |
You are correct about . and .. - getting a regex to match
them reliably is far trickier than it looks. The obvious
m/^\.\.?$/, for instance, will give a false
positive on "..\nsubdir". Much safer and simpler to just
test on ($_ ne '.') && ($_ ne '..'). (BTW,
!= is numeric. Use ne for
strings.)
In Section
Seekers of Perl Wisdom
|
|