our $x = 0; foreach(@values){ local $x; /m(\w+)\.(\d+)/ and my ($f,$s) = ($1,$2); print "-- $_: $1;$s; ",$x++,"\n" }