hey guys i have just started learning perl, and i dont know much more than her (so dont use complicated answers or scripts) thanks in advance
#!/usr/bin/perl use strict; use warnings; print "please enter number 1 = "; my $num1 = <STDIN>; print "please enter operation = "; my $opr1 = <STDIN>; print "please enter number 2 = "; my $num2 = <STDIN>; if ($opr1 eq '+'){ print "$num1 $opr1 $num2 = " . ($num1 + $num2) . "\n"; } if ($opr1 eq '-'){ print "$num1 $opr1 $num2 = " . ($num1 - $num2) . "\n"; } if ($opr1 eq '*'){ print "$num1 $opr1 $num2 = " . ($num1 * $num2) . "\n"; } if ($opr1 eq '/'){ print "$num1 $opr1 $num2 = " . ($num1 / $num2) . "\n"; }
In reply to calculator help by Paradizingmania
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |