http://www.perlmonks.org?node_id=469744


in reply to Re: "or die" versus "|| die"
in thread "or die" versus "|| die"

Just because you're invoking die after an || or a or doesn't mean you don't have to think about precedence. Consider the following:

somesub $this, $that || die;

If you use 'or' here, you'll die upon failure of somesub (assuming it returns false to indicate failure). If you use ||, you'll die if $that is false. Big difference.


Dave