in reply to Passing logical operators on as content of scalar
You can get it to be shorter with the ternary operator. This replaces your elsif block.
elsif ($selectioncriterium eq '=='){ print "$number1 is ", $number1 == $number2 ? '' : 'not ', "equal t +o $number2\n"; }
For <, >, == it isn't as easy since there are three choices.
|
|---|