in reply to Re: "or die" versus "|| die"
in thread "or die" versus "|| die"
No they cannot be used interchangeably in all places, the word versions are specifically guaranteed to have lower precedence than the symbol versions (infact guaranteed to have the lowest precedence of any operators), you might care to try for instance:
As you can see the latter doesn't behave as expected as the '||' binds more tightly and ends up taking the value of the filename - infact the check is optimised away because this is essentially a no-op, as the output from B::Deparse shows:
open ONE, "somefilethatdoesnexist" or print "one: $!\n";
open TWO, "somefilethatdoesnexist" || print "two: $!\n";
print "one: $!\n" unless open ONE, 'somefilethatdoesnexist';
open TWO, 'somefilethatdoesnexist';