==================================================================
> I lie: the other reason qr{} currently doesn't behave like that is
that
> when we interpolate a compiled regexp into a context that requires
it be
> recompiled,
Interpolated qr() items shouldn't be recompiled anyway. They should
be treated as subroutine calls. Unfortunately, this requires a
reentrant regex engine, which Perl doesn't have. But I think it's the
right way to go, and it would solve the backreference problem, as well
as many other related problems.
==================================================================
The REx engine is reenterant enough right now. All you need to do is
to add the //p switch (or, meanwhile, rewrite each $qrn into (?p{ $qrn })).
Ilya