If you're not terribly worried about resource cleanup, there's always POSIX::_exit():
#!/usr/bin/perl -w use strict; use POSIX (); END { warn "Exiting $$\n"; } die "Couldn't fork\n" unless defined( my $pid = fork() ); if ($pid) { print "Parent is $$, child is $pid\n"; } else { print "Child is $$\n"; POSIX::_exit( 0 ); }
In reply to Re: Test::Cmd and forking
by chromatic
in thread Test::Cmd and forking
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |