in reply to Re: -e and unlink
in thread -e and unlink
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: $!" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: -e and unlink
by merlyn (Sage) on Mar 14, 2001 at 05:04 UTC | |
by Adam (Vicar) on Mar 14, 2001 at 07:33 UTC | |
by tye (Sage) on Mar 15, 2001 at 05:35 UTC |