|Syntactic Confectionery Delight|
Inputing an Operator is it possible?by $Variable_B
|on Oct 07, 2002 at 02:37 UTC||Need Help??|
$Variable_B has asked for the
wisdom of the Perl Monks concerning the following question:
Hello Wise and Helpful Monks, I have a question for you that troubles me...
Ok, so I got bored and I thought I would make a calculator as one of my first programs. I figured out how to make it do anything, but you had to change the script everytime you had a different problem or operator. Then, as time went on I learned more as we all do. I learned the concept of "<STDIN>" so that I wouldn't have to change the script for new variables because the user would input them. I ended up with this and this is far as I have gotten in my problem.
I have a problem though. As you can see I need to change the script if I want any other operation such as: subtraction, powers, multiplication, division, etc...
I haved asked in the CB and searched my books and the web but in vain, because I cannot find a way to make the user input the operation. I thought that this idea might look like....
but I was obviously and expectedly wrong.
Any ideas on how I can get this little operation input problem fixed?