in reply to Any difference in conditionals?

As they stand, they are logically equivalent.

Your type1 is noisier, but more flexible. If steps may be added for other logical combinations, it will be easier to modify. Readibility declines rapidly with that.

I would prefer type2 for anything that is expected to be stable. It can be reduced further by modifier syntax, print 'here', $/ if $x1 && $x2; or logical operators, $x1 && $x2 && print 'here', $/; which some regard as unreadable, but I like for the lack of noise. The modifier syntax suffers from the need to squeeze everything in the conditional into a single Perl expression.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Any difference in conditionals?
by TimToady (Parson) on Apr 27, 2004 at 17:15 UTC
    Um, your logical operator expression also squeezes the conditional into a single Perl expression. It just happens to use the same operator inside as the conditional.