in reply to exit value not passed back

I suspect the exit value is unsigned, so your negative return code is causing a problem here. perldoc -f exit suggests that:

The only universally recognized values for EXPR are 0 for success and 1 for error; other values are subject to interpretation depending on the environment in which the Perl program is running.

Try it with some positive values and see what you get.


s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&

Replies are listed 'Best First'.
Re^2: exit value not passed back
by mags (Initiate) on Oct 06, 2004 at 09:56 UTC
    Well I tried exit value of 3, but still getting $? returned as 256 and when I shift it right by 8 bits I still get 1 !!!

    Mags

      That is odd. I used your code as the basis of a test program and got results as expected, after the system() returns, $? = 768, shift it right 8 bits and you get 3 (which is what I had called.pl exit with).

      This is on Unix (HP-UX) by the way. Things may vary on other platforms - I think that is what the perldoc extract I quoted before is trying to say. What OS are you using?


      s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&