# Use a closure to add a new behavior to the # chain of behavior for the interupt handler { my $OldINTHandler = $SIG{'INT'}; defined $OldINTHandler or $OldINTHandler = sub { exit(2); }; sub NewIntHandler { unlink(@LockFileArray); &{$OldINTHandler}; } # Install the new handler $SIG{'INT'} = \&NewIntHandler; }