![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
die on file openby rgren925 (Beadle) |
on Jan 11, 2011 at 19:55 UTC ( #881747=perlquestion: print w/replies, xml ) | Need Help?? |
rgren925 has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I'm finding a peculiarity on file open (perl 5.8.3) that I can't find any explanation for in the doc.
When I call open as a command:
open $REQUESTFILE, '<', $aldbRequestFile || die "Unable to open ALdb Request file $aldbRequestFile: $!\n";
die never gets invoked when the file doesn't exist.
Yet, when I call it as a function:
open (my $REQUESTFILE, '<', $aldbRequestFile) || die "Unable to open ALdb Request file $aldbRequestFile: $!\n";
die works as expected.
Can one of the perl gurus please explain this?
Thanks,
Rick
Thanks very much ikegami and kennethk! Didn't even think of precedence
Back to
Seekers of Perl Wisdom
|
|