UPDATE: As blazar points out, while this code does what you want, know that it will blissfully run any valid Perl command. You might add some editing of your input before handing it to eval.chomp($exp = <STDIN>); $out = eval $exp; print $out, "\n";
Good Luck,
Trix
In reply to Re: Chomp a numerical expression, return the answer.
by Trix606
in thread Chomp a numerical expression, return the answer.
by sub_chick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |