{ my $var = 1; $SIG{HUP} = sub { print "HUP; \$var=$var\n"; $var++; }; } print "in main program, \$var=$var\n"; kill('HUP', $$); print "in main program, \$var=$var\n"; kill('HUP', $$); print "in main program, \$var=$var\n";