in reply to frac12 to decimal

Any time you see chr, you are invoking the Perl internal character set. The display values are therefore not 1/2, etc. but a single character ½ that looks similar. As such, to convert to a decimal, you need to associate that fraction character with the appropriate decimal value. The inverse function of chr is ord, so you could go through the unicode character set (unicode tables) to find all appropriate values. I would recommend checking the CPAN modules HTML::Fraction and String::Fraction for some mappings you could "borrow".