Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-09-23 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (239 votes), past polls