use IPC::System::Simple qw(run); my $exit_value1 = run("foo", @args); my $exit_value2 = run([0..5], "foo", @args);