in reply to bsd_glob does not reset $!
It's stated very clearly in File::Glob.
If an error occurred, &File::Glob::GLOB_ERROR will be non-zero and $! will be set. &File::Glob::GLOB_ERROR is guaranteed to be zero if no error occurred
perlvar has more to add on $!. (Emphasis in the original.)
This means that the value of $! is meaningful only immediately after a failure. [...] A successful system or library call does not set the variable to zero.
There's even an example in File::Glob's Synopsis. (The example was adjusted to your case.)
@list = bsd_glob($pat, GLOB_ERR); if (GLOB_ERROR) { # an error occurred }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: bsd_glob does not reset $!
by stefan k (Curate) on Sep 29, 2006 at 07:44 UTC | |
by ikegami (Patriarch) on Sep 29, 2006 at 15:19 UTC |