Check the return (error) status of open with $! (Tip #7 from Basic debugging checklist).
I think die statements all over the place diminish code readability myselfautodie was created to address that issue.
Re-writing your code with more modern/robust style:
open my $fh, '<', $file or die "can't find input file $!";
In reply to Re: opening missing file inside eval statement
by toolic
in thread opening missing file inside eval statement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |