Help for this page

Select Code to Download


  1. or download this
    for my $letter ( split // => $phrase ) { 
             $sum += $numeral{$letter} || 0; 
     }
    
  2. or download this
    use List::Util qw(sum); # in the CPAN
    
    $sum = sum map $numeral{$_}, $phrase =~ /([IVXCLMD])/g;