use strict; use warnings; use Data::Dump qw/ddx/; use autodie; my $dir = "/tmp"; my $file = "$dir/tst_unlink"; open my $fh, ">>", $file; print $fh "ENTRY ".__LINE__; ddx <$file*>; unlink $file; print $fh "ENTRY ".__LINE__; ddx <$file*>; eval { link $fh, "${file}_new"; } or warn $@; eval { link $file, "${file}_new"; } or warn $@; ddx <$file*>; __DATA__ #### # open_unlink.pl:16: "/tmp/tst_unlink" # open_unlink.pl:22: () Can't link($fh, '/tmp/tst_unlink_new'): Datei oder Verzeichnis nicht gefunden at ./open_unlink.pl line 24 Can't link('/tmp/tst_unlink', '/tmp/tst_unlink_new'): Datei oder Verzeichnis nicht gefunden at ./open_unlink.pl line 26 # open_unlink.pl:29: ()