Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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 exploiting the Monastery: (5)
As of 2015-10-04 17:41 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (103 votes), past polls