in reply to Re: Ternary operators: a hinderance, not a help
in thread Ternary operators: a hinderance, not a help
OTOH, if the "..." is different in each case, I might take the trouble to put that into a hash...my $val = ( $EXPR ) ? $x : $y; my $var = sprintf( "...", $val );
And I agree with you and with earlier replies: it's a matter of personal preference for those of us who feel a sense of "semantic unity" in certain conditional assignments.my %format = ( $x => "... for x", $y => "... for y" ); my $val = ( $EXPR ) ? $x : $y; my $var = sprintf( $format{$val}, $val );
|
|---|