Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by eyepopslikeamosquito (Bishop)
on Nov 25, 2020 at 01:15 UTC ( #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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2023-03-28 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (68 votes). Check out past polls.

    Notices?