I was asked this question in an interview for an internship, and the first solution I suggested was to try and use a regular expression (I usually am a little stumped in int
how about:
while ($line =~ s/^([a-z]+)(\d+)//i) { print $1 x $2; }