consequence() if condition(); # or
condition() and consequence();
And the choice between:
consequence unless condition(); # or
condition() or consequence();
Is mostly a question of front-loading. What part of the statement seems the most important in its context? If we're just trying to avoid warnings about undef values, then adding if defined $foo to the end of a statement seems less obnoxious than putting the condition up front. But if we're going to do a lot of processing on $line, then my $line = <$fh> or return; is probably clearer than return unless my $line = <$fh>;.
|