in reply to Hash Key vs. Quantifier Ambiguity in Regex Context

(1) How regex strings are interpolated is a messy business. Usually it DWIM, but you hit a case where it doesn't. See Gory-details-of-parsing-quoted-constructs for more details.

(2), I'd rename one of the x variables or do the interpolation my self:

my $x = "(quantifier)"; my %x = ( "1" => "(hash_value)" ); my $z = 'quantifier hash_value'; my $ele = $x{1}; print "_$1_\n" if $z =~ /$ele/;
For the third question, I'd probably play at perturbing perl's probabilistic parser, and not get anywhere :)

-Mark