Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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( "{.*,*}" );

Comment on Re: Re: File::Glob Ignores Dot Files
Download Code
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 taking refuge in the Monastery: (7)
As of 2015-12-01 05:10 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (794 votes), past polls