What do you think about if( open($fh, '<', $foo) || open($fh, '<', $bar)
Dogfood time? ;-)
for my $infile ($foo, $bar) { last if open ($fh, '<', $infile); warn "Cannot open '$infile' for reading: $!"; } unless (eof $fh) { ... } else { warn "None of the files could be opened. What a shame."; }
I take your point though and there it's arguable whether on not it's control flow. I would not object to either || or or in such a situation.
In reply to Re^5: "open" Best Practices
by hippo
in thread "open" Best Practices
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |