in reply to die on file open
open $REQUESTFILE, '<', $aldbRequestFile || die "Unable to open ALdb Request file $aldbRequestFile: $!\n";
the || binds more tightly than the ,, so that means that the or is never evaluated so long as your file name is true. On the other hand, when you add parentheses, the or is tested against the return value of the open, and hence returns what you expect. Two possible solutions are to include the parentheses or use the lower precedence or (Logical or, Defined or, and Exclusive Or), which is more common in Perl:
open $REQUESTFILE, '<', $aldbRequestFile or die "Unable to open ALdb Request file $aldbRequestFile: $!\n";
As a side note, please wrap code in <code> tags - see Writeup Formatting Tips.
|
|---|