Here's an SSCCE:
#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 1; my $x = 7; my $y = 5; my $z; my $formula = '$z = $x + $y'; eval $formula; is ($z, 12)
Note that your script would be essentially executing arbitrary perl code from another source so this is a big security risk and you ought not to do it.
In reply to Re: How to evaluate a mathematical formula that is stored in another file?
by hippo
in thread How to evaluate a mathematical formula that is stored in another file?
by skooma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |