Text::Roman - Online Linux Manual PageSection : 3
Updated : 2022-01-21
Source : perl v5.34.0
Note : User Contributed Perl Documentation
NAMEText::Roman − Allows conversion between Roman and Arabic algarisms.
VERSIONversion 3.5
SYNOPSIS #!/usr/bin/env perl
use strict;
use warnings;
use Text::Roman qw(:all);
print int2roman(123), "\n";
my $roman = "XXXV";
print roman2int($roman), "\n" if isroman($roman);
my $milhar = 'L_X_XXIII'; # = 60,023
print milhar2int($milhar), "\n" if ismilhar($milhar);
DESCRIPTIONThis package supports both conventional Roman algarisms (which range from 1 to 3999) and Milhar Romans, a variation which uses a bar across the algarism to indicate multiplication by 1_000. For the purposes of this module, acceptable syntax consists of an underscore suffixed to the algarism e.g. IV_V = 4_005. The term Milhar apparently derives from the Portuguese word for ‟thousands” and the range of this notation extends the range of Roman numbers to 3999 * 1000 + 3999 = 4_002_999. Note: the functions in this package treat Roman algarisms in a case-insensitive manner such that ‟VI” == ‟vI” == ‟Vi” == ‟vi”. The following functions may be imported into the caller package by name:
FUNCTIONS
isromanTests a string to be a valid Roman algarism. Returns a boolean value.
int2romanConverts an integer expressed in Arabic numerals, to its corresponding Roman algarism. If the integer provided is out of the range expressible in Roman notation, an undef is returned.
roman2intDoes the converse of ‟int2roman”, converting a Roman algarism to its integer value.
ismilharDetermines whether a string qualifies as a Milhar Roman algarism.
milhar2intConverts a Milhar Roman algarism to an integer.
ismroman/mroman2int/romanThese functions belong to the module's old interface and are considered deprecated. Do not use them in new code and they will eventually be discontinued; they map as follows: • ismroman => ismilhar • mroman2int => milhar2int • roman => int2roman
CHANGESSome changes worth noting from this module's previous incarnation: namespace imports The call to use must now explicitly request function names imported into it's namespace. argument defaults/void context All functions now will operate on $_ when no arguments are passed, and will set $_ when called in a void context. This allows for writing code like: @x = qw/V III XI IV/;
roman2int() for @x;
print join("−", @x);
instead of the uglier: @x = qw/V III XI IV/;
$_ = roman2int($_) for @x;
print join("−", @x);
SPECIFICATIONRoman algarisms may be described using the following BNF-like formula: a = I{1,3}
b = V\a?|IV|\a
e = X{1,3}\b?|X{0,3}IX|\b
ee = IX|\b
f = L\e?|XL\ee?|\e
g = C{1,3}\f?|C{0,3}XC\ee?|\f
gg = XC\ee?|\f
h = D\g?|CD\gg?|\g
j = M{1,3}\h?|M{0,3}CM\gg?|\h
REFERENCESFor a description of the Roman numeral system see: <http://www.novaroma.org/via_romana/numbers.html>. A reference to Milhar Roman alagarisms (in Portuguese) may be found at: <http://web.archive.org/web/20020819094718/http://www.estado.com.br/redac/norn−nro.html>.
ACKNOWLEDGEMENTSThis module was originally written by Peter de Padua Krauss and submitted to CPAN by Stanislaw Pusep <https://metacpan.org/author/SYP> who has relinquished control to Erick Calder <https://metacpan.org/author/ECALDER> since the original author has never maintained it and can no longer be reached. Erick have completely rewritten the module, implementing simpler algorithms to perform the same functionality, adding a test suite, a Changes file, etc. and providing more comprehensive documentation. Ten years later, Stanislaw returned as a maintainer.
AUTHORStanislaw Pusep <stas@sysd.org>
COPYRIGHT AND LICENSEThis software is copyright (c) 2003 by Erick Calder <ecalder@cpan.org>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. 0
Johanes Gumabo
Data Size : 14,843 byte
man-Text::Roman.3pmBuild : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 201,381
Visitor ID : :
Visitor IP : 3.145.12.233 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|Text::Roman.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|Text::Roman.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|Text::Roman.3pm|43|br══─}─══|'br══─}─══
) (htmlprn|149|Text::Roman.3pm|43|'br══─}─══ |'br══─}─══
)