and and or were introduced as lower precedence versions of && and ||, infact their precedence is guaranteed to be lower than any other operator so you can use them in places where otherwise you would have to use additional or otherwise unnecessary parentheses to ensure the correct meaning of a statement. This is probably clearest seen in:
open HANDLE, $file || die $!;
which is almost certainly a mistake (i.e. it won't die unless
$file has a false value because the
|| has higher precedence than the comma in the argument list.) If you want to use
|| you would need to use the parentheses thus:
open(HANDLE, $file) || die $!;
Whereas:
open HANDLE, $file or die $!;
works fine.
In most places it is mostly a stylistic choice of whether to use the higher priority operator and more parentheses or not.
/J\