in reply to Re: Perl as a Holy Weapon?
in thread Perl as a Holy Weapon?

You could further simpify (and speed up) the code:
for my $letter ( split // => $phrase ) { $sum += $numeral{$letter} || 0; }
to just
use List::Util qw(sum); # in the CPAN $sum = sum map $numeral{$_}, $phrase =~ /([IVXCLMD])/g;
Remember list context m//g. Once you get your head around it, you can do many things for which split seemed awkward.

-- Randal L. Schwartz, Perl hacker