in reply to Looping on a match, and value of $1

Bah, beaten to the explanation. At any rate, you can see this if you go into the debugger (perl -de 0) and examine the list produced and $1.

DB<1> $a = "1b2cde5" DB<2> x $a =~ /(\d+)/g, $1 0 1 1 2 2 5 3 5