in reply to New Program

Take a look at Math::Fraction before you spend too much more time reinventing the wheel.

-- Randal L. Schwartz, Perl hacker