- or download this
my $ch = Proc::Background->new(@command);
if (defined $ch->pid()) {
...
# failed to execute
exit 127;
}
- or download this
$ perl /tmp/scratch.pl true
[child] Executing true
...
[parent] Terminating with exit code 0.
<after 5 seconds>
[child] Exiting with exit code 1.
- or download this
#!/usr/bin/env perl
...
return $exitcode;
}
- or download this
#!/usr/bin/env perl
...
say("[child] Exiting with exit code $exitcode.");
exit $exitcode;
}