in reply to Odd warning

Weird. The code looks straightforward. If the regex matches, you should have a single digit in $1.

Can you isolate (and post) a record in @rec that causes the warning? That'd give us a bit more to go on.