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


in reply to open failure code

It's all about operator precedence. For more information about precedence theory checkout perlop.
Regarding your specific problem:
The line  open ($fh,$log) || $down = 'moo'
is evaluated as (open ($fh,$log) || $down) = 'moo';
Obviously, open isn't an lvalue function; you can't assign it a value.
$log = "moooojlfdkafj.txt"; $down="false"; open (FH, $log) || ( $down = "true" ); print $down;
or
$log = "moooojlfdkafj.txt"; $down="false"; open (FH, $log) or $down = "true"; print $down;
work.

Gyan Kapur