while ( ) { chomp; until( /[^\d]/ ) { print "$_"; } } __DATA__ 1 A B C