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;