I bumped into a bug in perl 5.6.1
It seems that qr// can compile regexps to true lexical variables only in perls above 5.6.1. Otherwise, they get compiled to globals (or package-scoped variables) even if they involve my-scoping. (Maybe the regexp gets compiled to a global and the local variable is just a pointer to the global.)
It seems that "my" for regexps is also broken.
I think this is the issue.