#!/usr/local/bin/perl -w $SIG{INT} = sub { warn "in parent"; exit; }; for ( 0 .. 100) { my $pid = fork; unless (defined $pid) { die "Error forking"; } unless ($pid) { exec ("./test2.pl"); } else { wait; } }