in reply to calculator help

The first anonymous monk gave you some places to start reading, however, since it seems you need a quick answer, here it is.

Before your if statements, add the following line to get rid of unwanted white space which would make your if statements return false (I hope I said that right)...

chomp( $num1, $opt1, $num2 );
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

Replies are listed 'Best First'.
Re^2: calculator help
by RonW (Parson) on Jun 02, 2014 at 16:57 UTC

    also, to trim all leading/trailing white space:

    s/^\s+//; # trim leading white space s/\s+$//; # trim trailing white space

    Or use one of the Trim modules mentioned.