in reply to To || or not to or and why.
I guess an equivalent to your situation might be:@info = stat($file) || die; # oops, scalar sense of stat! @info = stat($file) or die; # better, now @info gets its due
The second will return undef or set the only element of @Candidates to the number of arguments passed in. So in effect 'or' is allowing operators, including assignments, to be completely evaluated, without inducing any side-effects.my @Candidates = @_ or return; my @Candidates = @_ || return;
|
|---|