Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: using re 'eval' for varibable math

by tall_man (Parson)
on Apr 19, 2005 at 20:53 UTC ( #449426=note: print w/replies, xml ) Need Help??


in reply to using re 'eval' for varibable math

The Math::Pari module can evaluate mathematical expressions with a more restricted syntax than perl's -- but watch out for "system()". Here's an example.
use strict; use Math::Pari qw(PARI); my $question="67.35 >= 50 && 67.35 < 80"; # Pari doesn't like white space in expressions. $question =~ s/\s+//g; my $out = PARI $question; print $out,"\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://449426]
help
Chatterbox?
[stevieb]: I have learned that my daughter has significant brain injury, so that's affecting my decisions. Don't know who to reach out to. I just want to vent. I am honestly lost. It's something I can't code around.
[stevieb]: I am infuriated at the same time I am hopeless. It appears there are approaches to 'fix' things, but, you know..,

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-02-25 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (365 votes). Check out past polls.