7 next unless -l $source;
8 my $target = readlink $source or die "readlink $source: $!";
9 my $trap = sub { unlink $source;
10 symlink $target, $source;
11 print "Caught a SIG$_[0]!\n";
13 local ($SIG{HUP}, $SIG{INT}, $SIG{TERM}, $SIG{QUIT}, $SIG{__DIE__}) =
14 ($trap, $trap, $trap, $trap, $trap);
15 unlink $source or die "unlink $source: $!";
16 copy $target, $source or die "copy $source to $target: $!";