Strtol

Score: 171.42 (pass)

$@*10**$; -> $@.0 x$; argh, can't get bitwise solution to work and alternative commify solutions are bigger

#!perl -lap
y/mb/sn/,/../,$@+=zeontwthfofisiseeiniteel!~/$&/?$@*=50:($;=$-[0]/2,/y/?10*$;:/lv|een/?10+$;:/.{7}/?($n+=$@.0 x$;,-$@):$;)for@F;$_=$n+$@;1 while s/(?<=\w)\w{3}\b/,$&/

Score: 172.41 (pass)

I made it so prefix match only fails for hu(ndred) by moving eleven into ones bucket which allowed some consolidation. Now I have to figure a better way to commify.

#!perl -lap
y/mb/sn/,/../,$@+=zeontwthfofisiseeiniteel!~/$&/?$@*=50:($;=$-[0]/2,/y/?10*$;:/lv|een/?10+$;:/.{7}/?($n+=$@*10**$;,-$@):$;)for@F;$_=$n+$@;1 while s/(?<=\d)\d{3}\b/,$&/

Score: 175.41 (pass)

?do{}: -> ?(): e(l|en) -> el|een $@*100-$@ -> $@*=50

#!perl -lap
y/mb/sn/,/../,$;=zeontwthfofisiseeinite=~/$&/?$-[0]/2:1,$@+=/y/?10*$;:/el|een/?10+$;:/hu/?$@*=50:/.{7}/?($n+=$@*10**$;,-$@):$;for@F;$_=$n+$@;1 while s/(?<=\d)\d{3}\b/,$&/

Score: 184.40 (pass)

I forgot I wasn't using strict, removed quotes and also shortened pattern for thousand,[mb]illion from [ih]o to .{7} I am still proud of y/mb/sn/ to get my 3,6,9

#!perl -lap
y/mb/sn/,/../,zeontwthfofisiseeinite=~/$&/,$;=$-[0]/2,$@+=/y/?10*$;:/e(l|en)/?10+($;||1):/hu/?$@*100-$@:/.{7}/?do{$n+=$@*10**$;;-$@}:$;for@F;$_=$n+$@;1 while s/(?<=\d)\d{3}\b/,$&/

Score: 187.40 (pass)

Using position of match on string is much more efficient than hash key for prefix lookup.

#!perl -lap
y/mb/sn/,/../,"zeontwthfofisiseeinite"=~/$&/,$;=$-[0]/2,$@+=/y/?10*$;:/e(l|en)/?10+($;||1):/hu/?$@*100-$@:/[hi]o/?do{$n+=$@*10**$;;-$@}:$;for@F;$_=$n+$@;1 while s/(?<=\d)\d{3}\b/,$&/

Score: 205.43 (pass)

?:?:?:?: is fun, plus a whopping one stroke improvement on commify from perlfaq5 by using regex blackmagic! 8^)

#!perl -lap
$d{$_}=++$%for qw(on tw th fo fi si se ei ni te);y/mb/sn/,/^../,$;=$d{$&},$@+=/y/?10*$;:/e(l|en)/?10+($;||1):/hu/?$@*100-$@:/[hi]o/?do{$n+=$@*10**$;;-$@}:$;for@F;$_=$n+$@;1 while s/(?<=\d)\d{3}\b/,$&/

Score: 239.45 (pass)

#!perl -lap
$d{$_}=++$i for qw(on tw th fo fi si se ei ni te);@d{mi,bi}=(6,9);for(@F){/^../;$;=$d{$&};$@+=10*$;if/y/;$@+=10+($;||1)if/e(l|en)/;$@*=100 if/hu/;$@+=$;if!/(.{6}|y)/;$n+=$@*10**$;,$@=0 if/[hi]o/}$_=$n+$@;1 while s/^(\d+)(\d{3})/$1,$2/

Score: 252.46 (pass)

totaling up and commifying afterwards seems a bit more efficient than my s/// of an output template

#!perl -lap
@d{on,el}=(1,1);$d{$_}=2+$i++for qw(tw th fo fi si se ei ni te);for(@F){/^../;$d=$d{$&};$@+=$d*10 if/y/;$@+=$d+10 if/e(l|en)/;$@*=100 if/hu/;$@+=$d if!/(.{6}|y)/;$m=/d/?3:/m/?6:9,$n+=$@*10**$m,$@=0 if/[hi]o/}$_=$n+$@;1 while s/^(\d+)(\d{3})/$1,$2/

Score: 293.48 (pass)

first working solution

#!perl -lap
$n="00bi00mi00th00";$s;@d{on,el}=(1,1);$d{$_}=2+$i++for qw(tw th fo fi si se ei ni te);for(@F){($p)=/(^..)/;$s+=$d{$p}*10 if/y/;$s+=$d{$p}+10 if/e(l|en)/;$s*=100 if/hu/;$s+=$d{$p}if!/(.{6}|y)/;$n=~s/$p/$s,/,$s=0 if/[hi]o/}$n.=$s;$_=$n;s/[bmt][ih]/0,/g;s/,0+(\d{3})\b/,$1/g;s/^[0,]{1,14}//