Strtol

Score: 332.49 (pass)

#!perl
$_="zeontwthfofisiseeiniteel";$n{$&}=$C++while s/..//;%o=(hun=>100,tho=>1000,mil=>10**6,bil=>10**9);foreach(split(" ",<>)){$w=$o{substr($_,0,3)};if($w){if($l>$w){$z+=$c;$c=0}$c=($c+$p)*$w;$p=0;$l=$w}else{$m=$n{substr($_,0,2)};$m*=10if/ty$/;$m+=10if/een|wel/;$p+=$m}}$_=($z+$c+$p);while(s/\d{1,3}$//){$q=$&.$Q.$q;$Q=','}print$q."\n";

Score: 444.49 (pass)

#!perl
%n=(ze=>0,on=>1,tw=>2,th=>3,fo=>4,fi=>5,si=>6,se=>7,ei=>8,ni=>9,te=>10,el=>11);
%o=(hun=>100,tho=>1000,mil=>10**6,bil=>10**9);
foreach(split(" ",<>)) {$N=$n{substr($_,0,2)};$m=$N;if(/ty$/){$m=10*$N}elsif(/lve|een|twe/){$m=10+$N}$_=substr($_,0,3);
if($o{$_}){if($l>length$o{$_}){$z+=$c;$c=$p*$o{$_}}else{$c=($c+$p)*$o{$_}}$p=0;$l=length($o{$_})}else{$p+=$m}}
my $a=reverse($z+$c+$p);while($a=~s/([0-9]{3})([^,])/$1,$2/){}print((reverse$a)."\n");