Print the @refs mid-way through and verify that all the elements hold the last substr.
To explore whether it's one lvalue per string it came from, or per substr token in the program, or whatever, try calling substr again after the loop on the same $s.