http://www.perlmonks.org?node_id=575475


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

Hi all,
a few notes on the replies I am still trying to get this working. Any more pointers?

Following an old rule o' thumb: there must be something very dumb in my thinking or in my code, taking into account the amount of time I have already spent with this problem ;-)

Regards... stefan k
you begin bashing the string with a +42 regexp of confusion

Replies are listed 'Best First'.
Re^3: bsd_glob does not reset $!
by ikegami (Patriarch) on Sep 29, 2006 at 15:19 UTC

    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.