w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to capture the exit code of a shell script in a perl script?

You can check the exit code of another process with the child error variable $?. For example:

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

Read the documentation for more info.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.