Take a look at Math::Expr. That may be what you are looking for.
HTH
In reply to Re: Parsing a Formula by pzbagel in thread Parsing a Formula by Anonymous Monk