Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Description

Roman is a module for conversion between Roman and Arabic numerals.

use Roman; $arabic = arabic($roman) if isroman($roman); $roman = Roman($arabic); $roman = roman($arabic);

Why use Roman?

  • to number list item numbers in roman format
  • to display dates in an MPAA approved format

Why NOT use Roman?

  • if you need Roman numbers above 4000 (or if you don't need roman numbers!)

Note: the module does not have a Makefile.PL, so you will have to copy it in your perl module path yourself that should be something like /usr/lib/perl5/site_perl/5.6.0/. Alternatively you can use ExtUtils::MakeMaker to generate a Makefile.PL:

perl -e 'use ExtUtils::MakeMaker; WriteMakefile(NAME => "Roman");'

Personal comments

Roman is a little module that I found when I had to convert Roman numbered lists from XML to HTML. Instead of spending half an hour remembering how those guys counted then writing it myself it took me 5 minutes to install a generic solution. Cool!

I guess now with Unicode being available the module could be upgraded to handle more numbers.

Update: it might look like Dominus does not quite like Roman: Roman.pm is a new contender for stupidest Perl module ever written. but he is actually talking about a different module, one he wrote himself and apparently never submitted to CPAN, which allows you to write things like $IV+$IV and get VIII as a result.


In reply to Roman by mirod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found