Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Re: File::Glob Ignores Dot Files

by iburrell (Chaplain)
on Nov 25, 2003 at 19:57 UTC ( #310042=note: print w/replies, xml ) Need Help??

in reply to Re: File::Glob Ignores Dot Files
in thread File::Glob Ignores Dot Files

That will include '.' and '..' in the list. I have seen a pattern that will leave those out but it is messy. It is simpler to filter them out.
my @files = grep { /^\.\.?$/ } bsd_glob( "{.*,*}" );

Replies are listed 'Best First'.
Re^3: File::Glob Ignores Dot Files
by Anonymous Monk on Aug 31, 2007 at 20:13 UTC
    System directories '.' and '..' can be ignored just by using file test flag '-f': my @files = grep { -f } bsd_glob( "{.*,*}" );

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://310042]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-10-22 08:19 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (294 votes). Check out past polls.