in reply to valid filehandle

You can also do this:

if (!open FILE, "<test.txt") { # do something if can't open } else { # do something if it is opened for reading }
As you can see, other solutions are available as well.