IF you don't care about reporting errors, then unlink $filename; is sufficient.
IF you DO care about reporting errors (such as a failure to remove a file that your script lacks permission to remove), then you'll want to do something like:
if ( -e $filename ) { unlink($filename) or die "$filename: $!" }
In reply to Re: Re: -e and unlink
by dws
in thread -e and unlink
by DeusVult
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |