Strtol

Score: 234.52 (pass)

#!perl -apl
%v=split/(\d)/,on1tw2th3fo4fi5si6se7ei8ni9el1tho1mil2bil3;*q=\$a[0];for(@F){/((..).)/;if($m=$v{$1}){$a[$m]=$q;$q=0;$b||=$m}else{$a=$v{$2}+10*/te|l.?v/;$q+=$a+$a*9*/ty/;$q*=100if/dr/}}$_=$a[$b];$_.=sprintf',%03d',$a[$b]while$b-->0

Score: 235.51 (pass)

Bah, I'm just tweaking this. I need to come up with a better algorithm.

#!perl -apl
%v=split/(\d)/,on1tw2th3fo4fi5si6se7ei8ni9el1tho1mil2bil3;*q=\$a[0];for(@F){/((..).)/;if($m=$v{$1}){$a[$m]=$q;$q=0;$b||=$m}else{$a=$v{$2}+10*/te|l.?v/;$q+=$a+$a*9*/ty/;$q+=99*$q*/dr/}}$_=$a[$b];$_.=sprintf',%03d',$a[$b]while$b-->0

Score: 241.52 (pass)

#!perl -apl
%v=split/(\d)/,on1tw2th3fo4fi5si6se7ei8ni9el1tho1mil2bil3;*q=\$a[0];for(@F){/((..).)/;if($m=$v{$1}){$a[$m]=$q;$q=0;$b||=$m}else{$a=$v{$2};$a+=10*/te|l.?v/;$a*=10if/ty/;$q+=$a;$q*=100if/dr/}}$_=$a[$b];$_.=sprintf',%03d',$a[$b]while$b-->0

Score: 267.57 (pass)

No maps or greps. What's wrong with me?

#!perl -apl
%m=qw/tho 1 mil 2 bil 3/;%v=qw/on 1 tw 2 th 3 fo 4 fi 5 si 6 se 7 ei 8 ni 9 el 1/;*q=\$a[0];for(@F){/((..).)/;if($m=$m{$1}){$a[$m]=$q;$q=0;$b||=$m}else{$a=$v{$2};$a+=10*/te|l.?v/;/ty/and$a*=10;$q+=$a;/dr/and$q*=100}}$_=$a[$b];$_.=sprintf',%03d',$a[$b]while$b-->0

Score: 290.60 (pass)

Not good, but it gets me on the board.

#!perl -anl
%m=qw/tho 3 mil 2 bil 1/;%v=qw/on 1 tw 2 th 3 fo 4 fi 5 si 6 se 7 ei 8 ni 9 te 10 el 11/;*q=\$a[4];for(@F){/((..).)/;if($m=$m{$1}){$a[$m]="$q,";$a[$m]='000,'while++$m<4;$q='000';$b=1}else{$a=$v{$2};/tee|lv/and$a+=10;/ty/and$a*=10;$q+=$a;/dr/and$q*=100;$q=sprintf'%03d',$q if$b}}print@a