in reply to Re^6: Variable assignment error checking
in thread Variable assignment error checking

$var = $var || func( $var ); $var = func( $var ) || $var;
They're certainly logically equivalent if we disregard the short-circuiting nature of operators. (Though the mathematics branch of logic generally deals with no other return values than true and false...)

Replies are listed 'Best First'.
Re^8: Variable assignment error checking
by hdb (Monsignor) on Dec 15, 2013 at 10:41 UTC

    As you say, only if we only worry about true or false...

    my $var = 5; sub func { 10 }; print $var || func($var), "\n"; print func($var) || $var, "\n";