lenti218 [~/perltest]>more calc.pl #!/opt/local/bin/perl -w # demonstrate the common arithmetic operators in Perl print "Addition, subtraction, multiplication and division of two numbers.\n"; print "\n"; #get two numbers print " What is the first number? "; chomp($num1 = ); print "What is the second number? "; chomp($num2 = ); print "\n"; #addition $num3 = $num1 + $num2; print "$num1 + $num2 = "; print $num3; print "\n"; #subtraction $num3 = $num1 - $num2; print "$num1 - $num2 = "; print $num3; print "\n"; #multiplication $num3 = $num1 * $num2; print "$num1 * $num2 = "; print $num3; print "\n"; #division $num3 = $num1 / $num2; print "$num1 / $num2 = "; print $num3; print "\n"; exit; lenti219 [~/perltest]>perl calc.pl Addition, subtraction, multiplication and division of two numbers. What is the first number? 1 What is the second number? 2 1 + 2 = 3 1 - 2 = -1 1 * 2 = 2 1 / 2 = 0.5 lenti220 [~/perltest]>perl calc.pl This program demonstrates addition, subtraction, multiplication and division of two numbers. What is the first number? 2 What is the second number? 3 2 + 3 = 5 2 - 3 = -1 2 * 3 = 6 2 / 3 = 0.666666666666667 lenti221 [~/perltest]>