in reply to Re: Another eval $@ question
in thread Another eval $@ question

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: Another eval $@ question
by ikegami (Patriarch) on Oct 13, 2006 at 05:51 UTC

    system sets $? (not $!) to the return value of the child process, including whether it died from a signal. $! is only meaningful if system returned -1. If system didn't return -1, $! could be anything (undef, 0, some true value, etc). In your case, system did NOT return -1, having successfully run the shell (that in turn printed that error message), so printing $! would be wrong.

    Update: More detailed.