Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: bsd_glob does not reset $!

by ikegami (Pope)
on Sep 29, 2006 at 15:19 UTC ( #575548=note: print w/replies, xml ) Need Help??

in reply to Re^2: bsd_glob does not reset $!
in thread bsd_glob does not reset $!

Unfortunately it is not set to a value other than zero when the globbing produced no result

No matches is not an error. You could check for that condition explicitely.

if (GLOB_ERROR || !@list) { ... error or no match ... }

But then, why is it reset with $pat4 in the above example??

The value of $! is meaningless on success. It could be zero, non-zero, undef, etc.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2016-10-21 22:54 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.