Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Strange behaviour when using glob in if condition

by haukex (Archbishop)
on Apr 11, 2017 at 13:31 UTC ( #1187642=note: print w/replies, xml ) Need Help??


in reply to Strange behaviour when using glob in if condition

# do nothing if the directory is not empty return if glob("$directory/*");

glob skips filenames beginning with a dot, try return if glob("$directory/{*,.*}");

Update: Actually, upon re-reading the question I think I misunderstood what you are trying to do. Update 2: Yep, see my other reply for the solution.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2023-12-02 02:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (13 votes). Check out past polls.

    Notices?