To determine whether a file is deleted or not (i.e., as jrtayloriv pointed out, whether there is an entry for it in it's directory), I feel compelled to offer yet another possible solution.
When I want to know if a file has been deleted or not (in a unix-like system,) I run ls, to list the directory's contents. If the entry has been removed, the file should be missing.. so this is one option (somewhat simplified):
$filename = "openfile.yaml";
$directory = "/over/here/somewhere/i/think/";
$fileIsDeleted = (`ls $directory` !~ /$filename/gs);
print "Your file has ".($fileIsDeleted ? "" : "not ")."been deleted.";
This code has not been tested, but looks ok to me. It's really about the idea behind it anyway.