I think that the
or die statement will do what you want, however if you would like the script to continue on if the file doesnt exist rather than exiting, you may want to try testing for the file using
-e. Check out
this, or just try
if (-e $filename) {
open(FH, $filename);
}
humbly -c