![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: Unlinking a file when the file doesnt existby Gulliver (Monk) |
on Mar 22, 2011 at 18:15 UTC ( [id://894871]=note: print w/replies, xml ) | Need Help?? |
What if the file is actually a directory? I have never tried it but the documentation for unlink gives some warnings. How about:
Update: If the file tests are different then it would die after not attempting to delete a directory and $! would not be set. In that case -f is false and -e is true. If I make them the same that won't happen.
Better yet; do an unlink or warn.
In Section
Seekers of Perl Wisdom
|
|