You just need to read in the operator (- *) just like you read in the Name. Then you can use if.
Read about the if statement and comparison operatiors (eq == ne !=).if ($operator eq '-') { $c = $a - $b; } elsif ($operator eq '*') { # * code here } else { $c = 'invalid operator'; }
In reply to Re: Help with simple calculator script.
by monktim
in thread Help with simple calculator script.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |