in reply to The strangest use of unlink I know of
I thought it might be even more tricky still. Since %foo is empty, unlink gets an empty list. I thought that might mean that it would delete whatever is in $_ as if it got no argument, but that doesn't happen.
my $test_file = 'file_of_doom'; die 'file already exists' if -e $test_file; system( "touch $test_file" ); die 'file not created' if ! -e $test_file; $_ = $test_file; my %foo = (); unlink %foo; print "file gone!\n" if ! -e $test_file;
As it is, I think it just does nothing.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: The strangest use of unlink I know of
by Anonymous Monk on Feb 28, 2008 at 16:56 UTC |
In Section
Meditations