The same idea, except that it's a bit faster, still using only core modules.
use Math::Complex; $big = 0*i; $Problem = "6 * 8"; $Problem =~ /^(\d+)\s(\S)\s(\d+)$/; ($Number1, $Operator, $Number2) = +($1, $2, $3); $Answer = ($big + $Number1)->${\("(" . $Operator)}($Number2); print $Answer, "\n";
In reply to Re^2: '+' to +
by ambrus
in thread '+' to +
by NateTut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |