use POSIX(); system( @cmd ); my $child_exit_status = POSIX::WEXITSTATUS($?);