Prints 3. (eval will execute any perl code passed to it, so you should read up on taint checking and the -T switch).my $calc="1+2"; print eval ($calc) ."\n";
In reply to Re: extract an operator from a string
by Anonymous Monk
in thread extract an operator from a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |