How to capture the exit code of a shell script in a perl script? -


i want pop alert box using perl script. using exit 0 terminate shell script , exit 1 terminate shell script when error occurs. want capture exit code in perl script. , depending on value 0 or 1, want pop alert box success or failure message respectively.

you can check exit code of process child error variable $?. example:

system("perl foo.pl"); $exit_val = $? >> 8;   # contains exit value of perl script 

read documentation more info.


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

c++ - Issues with OpenGL referencing when compiling in Ubuntu terminal -

java - A* catch if unpossible to reach a point -