in reply to Re: Re: Parsing Math Strings
in thread Parsing Math Strings

Or use the Safe module and mask the operators that can be considered potentially harmful. This has the benefit of allowing the "math expression" to be arbitrarily complex (Perl, really), and if you pre-loaded things like Math::Complex, you could potentially have a very powerful "calculator."

Replies are listed 'Best First'.
Re: Re: Re: Re: Parsing Math Strings
by belg4mit (Prior) on Dec 07, 2001 at 03:48 UTC
    /me always forgets Safe (and Penguin)

    --
    perl -p -e "s/(?:\w);([st])/'\$1/mg"