in reply to Test::Cmd and forking
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 Section
Seekers of Perl Wisdom