123456789101112 #!/ursr/bin/env perluse strict;use warnings;my $pid = fork;unless ($pid) { exec 'perl', '-E', '$SIG{TERM} = sub{ print "TERM\n"; exit 0 }; sleep 1 while 1';}waitpid $pid, 0;
#!/ursr/bin/env perl
use
strict;
warnings;
my
$pid
=
fork
;
unless
(
) {
exec
'perl'
,
'-E'
'$SIG{TERM} = sub{ print "TERM\n"; exit 0 }; sleep 1 while 1'
}
waitpid
, 0;