in reply to Bug with Carp and $!/$?

You can report this to p5p with the perlbug utility.

My educated guess is that the problem is that $! gets set by the last failed system call. Normal Perl code generates a lot of harmless failures, and so you should not expect to have $! mean anything specific unless something just failed.

The flip side of that is that you should not expect $!'s value to be maintained through any complex code, such as the internals of Carp unless a specific effort is made to do so.

Replies are listed 'Best First'.
Re: Re: Bug with Carp and $!/$?
by Kageneko (Scribe) on Jul 10, 2003 at 17:43 UTC

    Good point, I never thought about that. I wonder if the documentation for Carp can be patched to recognize this caveat. Would that go in perlbug as well?

    Thanks a lot for your help, everyone. You've helped me keep my exit conditions and my beloved Carp :)