Strtol

Score: 253.60 (pass)

Last simple reductions. Leaving for vacation in a few hours, and will be offline.

Can I go back to bed, then?

#!perl -lp
y/euhi//d;s/ty/0/g;s/(\w+)tn/1$1/g;split/ /," zro on tw.n? tr for ff|fv sx svn gt? nn tn lvn twlv";s/$x/$#_/gwhile$x=pop@_;split/ /,"   n t   m   b";($x=pop@_)&&s/([^	]*) $x/($1)*1e$#_	/gwhile@_;s/\s+([^)])/+$1/g;$_=eval;1while s/(\d)(..\d)\b/$1,$2/

Score: 258.60 (pass)

Use "\w+" == 0 to my advantage

#!perl -lp
s/(\w+)teen/1$1/g;s/ty/0/g;y/eu//d;split/ /," zro on tw.n? thi?r for fi. six svn ight? nin tn lvn twlv";s/$x/$#_/gwhile$x=pop@_;split/ /,"   h t   m   b";($x=pop@_)&&s/([^	]*) $x/($1)*1e$#_	/gwhile@_;s/\s+([^)])/+$1/g;$_=eval;1while s/(\d)(..\d)\b/$1,$2/

Score: 266.62 (pass)

Some good unambiguous character deletions

#!perl -lp
s/(\w+)teen/1$1/g;s/ty/0/g;y/edu//d;split/ /," zro on tw.n? thi?r for fi. six svn ight? nin tn lvn twlv";s/$x/$#_/gwhile$x=pop@_;split/ /,"   hnr thosan   m   b";($x=pop@_)&&s/([^	]*) $x/($1)*1e$#_	/gwhile@_;s/\s+([^)])/+$1/g;$_=eval;1while s/(\d)(..\d)\b/$1,$2/

Score: 301.65 (pass)

Simple improvements

#!perl -lp
s/(\w+)teen/1$1/g;s/ty/0/g;split/ /," zero one two?e?n? thi?re?e? fou?r fif?v?e? six seven eight? nine ten eleven twelve";s/$x/$#_/gwhile$x=pop@_;split/ /,"   hundred thousand   million   billion";($x=pop@_)&&s/([^	]*) $x/($1)*1e$#_	/gwhile@_;s/\s+([^)])/+$1/g;$_=eval;1while s/(\d)(..\d)\b/$1,$2/

Score: 312.64 (pass)

Preliminary shortening

Congratulations, Chris. Looks like you're the only one awake (including me)

#!perl -lp
s/(\w+)teen/1$1/g;s/(\w+)ty/${1}0/g;split/ /," zero one two?e?n? thi?re?e? fou?r fif?v?e? six seven eight? nine ten eleven twelve";s/$x/$#_/gwhile$x=pop@_;split/ /,"   hundred thousand   million   billion";($x=pop@_)&&s/([^	]*) $x/($1)*1e$#_	/gwhile@_;s/\s+([^)])/+$1/g;$_=eval;1while s/(\d)(\d\d\d)\b/$1,$2/

Score: 356.61 (pass)

Nope, I pasted it badly (tabs->spaces). Try again...

#!perl -lp
s/(\w+)teen/1$1/g;s/(\w+)ty/${1}0/g;%r=split/(\d+)/,"zero00one1two2three3four4five5six6seven7eight8nine9ten10eleven11twelve12thir3fif5eigh8twen2for4";s/[a-z]+/$r{$&}||$&/ge;s/([^	]*) billion/($1)*1e9	/g;s/([^	]*) million/($1)*1e6	/g;s/([^	]*) thousand/($1)*1e3	/g;s/([^	]*) hundred/($1)*1e2	/g;s/\s+([^)])/+$1/g;$_=0+eval;1while s/(\d)(\d\d\d)\b/$1,$2/

Score: 393.65 (fail)

First working solution (hope I pasted it right...)

#!perl -lp
s/(\w+)teen/1$1/g;s/(\w+)ty/${1}0/g;%r=split/(\d+)/,"zero00one1two2three3four4five5six6seven7eight8nine9ten10eleven11twelve12thir3fif5eigh8twen2for4";s/[a-z]+/$
r{$&}||$&/ge;s/([^      ]*) billion/($1)*1e9    /g;s/([^        ]*) million/($1)*1e6    /g;s/([^        ]*) thousand/($1)*1e3   /g;s/([^        ]*)hundred/($1)*1e2    /g;s/\s+([^)])/+$1/g;$_=0+eval;1while s/(\d)(\d\d\d)\b/$1,$2/