Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: A short whishlist of Perl5 improvements leaping to Perl7

by eyepopslikeamosquito (Archbishop)
on Nov 25, 2020 at 01:15 UTC ( [id://11124180]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
      my %rtoa = ( M=>1000, D=>500, C=>100, L=>50, X=>10, V=>5, I=>1 );
    ...
        reduce { $a+$b-$a%$b*2 } map { $rtoa{$_} } split//, uc(shift)
      }
    }
    
  2. or download this
    def roman_to_dec(r, __rtoa = dict(M=1000, D=500, C=100, L=50, X=10, V=
    +5, I=1) ):
      return reduce( lambda t,n: t+n-t%n*2, (__rtoa[c] for c in r.upper())
    + )
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124180]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found