http://qs321.pair.com?node_id=469352


in reply to Re^2: No. files in folder
in thread No. files in folder

Indeed, this is IMHO another good reason to use glob instead. I thought it is never supposed to return qw/. ../, or are there osen where it does?!? I mean glob '*' of course. One can trim it to {his,her} own needs anyway. And if really need be, than the cure would be (fundamentally) the same.

Replies are listed 'Best First'.
Re^4: No. files in folder
by kaif (Friar) on Jun 23, 2005 at 15:03 UTC

    No, glob can return . and .. and nothing in the documentation seems to promise otherwise (I searched glob, perlop, and File::Glob). However, glob("*") will not return any dot-files, including the directories, because it works similarly to shell wildcards. Here's an example of where it does, though:

    $ perl -le'$,=" ";print glob(".*")' . .. .bash_history .bash_profile # and so on