Perl extension to model fractions