in reply to RE (tilly) 2: Populate $!
in thread Populate $!

I think you're digging yourself a velvet-lined grave here.

Yes, for many Perl child programs, the trivial use of die in that child program propogates their errno to their exit code.

But for the rest of the real world, no such propogation ever takes place. I think if you survey the exit status of nearly all other programs, you'll find a simple +1 or -1 (255) exit status, which your code will correctly misinterpret. {grin}

So, feel free to post your code, but be sure the reader is clear that it is intended for Perl child processes only.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE (tilly) 1: For Perl kids only!
by tilly (Archbishop) on Oct 11, 2000 at 23:02 UTC
    Excellent points.

    This thread should stand as warning to those thinking of using that snippet. In the example that brought this up I will clearly document that both in the function, and in the name. The new name will be guess_system_error.

    OTOH I want to use this for Perl children, so it is still useful for me.