Strtol

Score: 237.48 (pass)

#!perl -lpa
$f=1;@h{z,o,'tw(o|en)','th[^o]',fo,fi,si,se,ei,n,te,el,twel,h,tho,mi,b}=(0..12,1e2,1e3,1e6,1e9);map{/^$r/and$t>12?($f=$t>$f?$t:$f*$t):($g+=$f*(/een/?10+$t:$t)*(/y/?10:1))while($r,$t)=each%h}reverse@F;$_=$g;s/[\d,](?=(\d{3})+$)/$&,/g

Score: 242.48 (pass)

#!perl -lpa
$f=1;@h{z,o,'tw(o|en)','th[^o]',fo,fi,si,se,ei,n,te,el,twel,h,tho,mi,b}=(0..12,1e2,1e3,1e6,1e9);map{/^$r/&&($t>12?($f=$t>$f?$t:$f*$t):($g+=$f*(/een/?10+$t:$t)*(/y/?10:1)))while($r,$t)=each%h}reverse@F;$_=$g;1while s/(\d)(...)(,|$)/$1,$2/

Score: 255.47 (pass)

0.06 in front of Matt, perfect. :>

#!perl -lpa
$f=1;map$h{$_}=(0..12,1e2,1e3,1e6,1e9)[$?++],z,o,'tw(o|en)','th[^o]',fo,fi,si,se,ei,n,te,el,twel,h,tho,mi,b;map{/^$r/&&($t>12?($f=$t>$f?$t:$f*$t):($g+=$f*($t+(/een/?10:0))*(/y/?10:1)))while($r,$t)=each%h}reverse@F;$_=$g;1while s/(\d)(...)(,|$)/$1,$2/

Score: 267.48 (pass)

this is the sort of jump I like to see

#!perl -lna
$f=1;map{$h{$_}=(0..12,1e2,1e3,1e6,1e9)[$?++]}z,o,'tw(o|en)','th[^o]',fo,fi,si,se,ei,n,te,el,twel,h,tho,mi,b;map{for$r(keys%h){$t=$h{$r};$t>=100?($f=$t>$f?$t:$f*$t):($g+=$f*($t+(/een/?10:0))*(/y/?10:1))if/^$r/}}reverse@F;1while$g=~s/(\d)(...)(,|$)/$1,$2/;print$g

Score: 306.45 (pass)

Old solution fails for new test 47. This one is ok and slightly shorter.

#!perl
$s=<>;%h=(z,0,o,++$f,two,2,'th(?!o)',3,fo,4,fi,5,si,6,se,7,ei,8,n,9,te,10,el,11,twel,12,twen,2,h,1e2,tho,1e3,mi,1e6,b,1e9);while($s=~s/\s?(\w+)$//){$_=$1;for$r(keys%h){$h{$r}>=100?($f=$h{$r}>$f?$h{$r}:$f*$h{$r}):($g+=$f*($h{$r}+(/een/?10:0))*(/y/?10:1))if/^$r/}}1while$g=~s/(\d)(...)(,|$)/$1,$2/;print$g.$/

Score: 313.45 (pass)

#!perl
$s=<>;$f=1;%h=(z,0,o,1,two,2,'th[^o]',3,fo,4,fi,5,si,6,se,7,ei,8,n,9,te,10,el,11,twel,12,twen,2,h,1e2,tho,1e3,mi,1e6,b,1e9);while($s=~s/\s?(\w+)$//){$_=$1;for$r(keys%h){/^$r/?($h{$r}/10>=10?($f=$h{$r}>$f?$h{$r}:$f*$h{$r}):($g+=$f*$h{$r}*(/ty$/?10:1)+(/een$/?10:0))):0}}1while$g=~s/(\d)(...)(,|$)/$1,$2/;print$g.$/