[Melbourne-pm] Roman numerals & assessing a CPAN module

Andrew Savige ajsavige at yahoo.com.au
Fri Dec 11 20:12:43 PST 2009

MyfWhite wrote:
> I need to convert roman numerals to arabic, and there seem to be
> quite a few modules on the CPAN which can do this.

Just in case you prefer a one liner to a CPAN module:

use List::Util 'reduce';
sub roman_to_dec {

Only works for "modern" Roman Numerals in 1-3999 range ... and I
admit maintainability and readability may suffer. :)

A while back, I wrote up a node describing the algorithm behind this
monstrosity and even gave it a name, the PGA-TRAM algorithm:



See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20091211/c30a94ea/attachment.html>

More information about the Melbourne-pm mailing list