in reply to opening missing file inside eval statement
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 $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: opening missing file inside eval statement
by oko1 (Deacon) on Jan 08, 2011 at 23:30 UTC | |
by apl (Monsignor) on Jan 09, 2011 at 14:02 UTC |