in reply to Re^3: Use function as a regex
in thread Use function as a regex

Embarrasing. I read it exactly backwards. Something like while (str() =~ /(.)/g) can be made to work by using sub str :lvalue { state $x = "abcd" }.

Sorry about the noise.