in reply to how to convert fractional string to decimal numbers ?

If you trust your input, you can use eval.

Otherwise you will need to parse and evaluate it yourself. Math::Fraction looks like it should be able to parse that.

If it was for personal use I'd do an eval. If I somewhat trusted my users I'd do a simple sanity check then eval. Otherwise I'd parse it in Perl.

  • Comment on Re: how to convert fractional string to decimal numbers ?