6 next unless -l $source;
7 my $target = readlink $source or die "readlink: $!";
8 my $trap = sub { unlink $source;
9 symlink $target, $source;
10 print "Caught a SIG$_[0]!\n";
12 local ($SIG{HUP}, $SIG{INT}, $SIG{TERM}, $SIG{QUIT}, $SIG{__DIE__}) =
13 ($trap, $trap, $trap, $trap, $trap);
15 system '/bin/cp', $target, $source;