in reply to (Golf) Let's go bowling

Been a long time since I've had time to try one of these. My solution seems to be 168 characters, if I counted them properly.

sub score { $i=$z=0;@_=map{(/\d/)?$_:10}@_;while($i++<10){$x=shift;if($x<10){$y=sh +ift;$z+=($y==10)?10+$_[0]:$x+$y;}else{$z+=($_[0]==10)?20+$_[1]:($_[1] +==10)?20:10+$_[0]+$_[1];}}$z; }
Dave