my $ret_val = system("perl 2.pl"); if ( $ret_val == 0 ) { print "Success"; } else { printf "Error. Err Number: %d", $ret_val<<8; }