Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2018-01-18 04:35 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (206 votes). Check out past polls.