system("some_command"); if ($? == -1) { die "failed to execute: $!\n"; } elsif ($? & 127) { die "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { die "child exited with value %d\n", $? >> 8; } #### use IPC::System::Simple qw(run); run("some_command"); #### use IPC::System::Simple qw(run); run("foo"); # No meta-chars, shell never used run("bar | bar"); # Meta-chars, shell always used. run("foo", "bar", "