in reply to Searching for a file, confirming that it exists, then deleting it

You might have better luck with -e $filename and unlink.
  • Comment on Re: Searching for a file, confirming that it exists, then deleting it