#!/usr/bin/perl print "What is your name?\n"; $name = <>; chomp($name); $greeting = "Hello, " . $name . "\nWhat do type of math do you want th +is program to do?\n"; print $greeting; chomp($operator = <STDIN>); if ($operator eq 'sub') { $c = $a - $b; } elsif ($operator eq '*') { # * code here } else { $c = 'invalid operator'; }
Edit, BazB: closed code tag.
In reply to Re: Re: Help with simple calculator script.
by Anonymous Monk
in thread Help with simple calculator script.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |