In reply to Rick Wicklin.

In Perl specifically, the 'and' and 'or' keywords also have difference precedence than && and ||. Which one you use and when is very much driven by the idioms of the language more than mere pragmatism.

For example, consider the statement:

open my $fh, "file" or die "could not open file";

That statement works as you would expect (and nearly reads as English, but I digress). If you rewrote it as:

open my $fh, "file" || die "could not open file";

it behaves very differently. It never executes the "die" statement even if the 'open' fails.

(Note: The situation is different in C++, where the keywords 'and', 'or' and 'not' are literally interchangeable with &&, || and !.)

For the Practical Priyas of the world, you still have to take precedence into account if the language dictates it.