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


in reply to Or Operator

The answers above address your question directly. If you ever need to figure this out on your own, the B::Deparse module, which comes standard with every Perl distribution, can be very helpful:

$ perl -MO=Deparse -e 'my $foo = bar() or baz()' baz() unless my $foo = bar(); -e syntax OK $ perl -MO=Deparse -e 'my $foo = bar() || baz()' my $foo = bar() || baz(); -e syntax OK
You can see how the two are interpreted very differently.