Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: File::Glob Ignores Dot Files

by Paladin (Priest)
on Nov 25, 2003 at 18:45 UTC ( #310012=note: print w/ replies, xml ) Need Help??


in reply to File::Glob Ignores Dot Files

Just like your shell, * ignores files starting with .. You need to explicitly state it:

my @ary = bsd_glob( "/home/dvergin/{.*,*}" )


Comment on Re: File::Glob Ignores Dot Files
Select or Download Code
Re: Re: File::Glob Ignores Dot Files
by iburrell (Chaplain) on Nov 25, 2003 at 19:57 UTC
    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( "{.*,*}" );
      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://310012]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (22)
As of 2015-07-06 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls