in reply to Re^4: How we can separate a backref from a digit?
in thread How we can separate a backref from a digit?

Unexpected to you. Variable interpolation happens before the regular expression is parsed and compiled so there is no difference between

$a=1; print "Match\n" if "aa1" =~ /^(a)\1$a$/; # not match!
and
print "Match\n" if "aa1" =~ /^(a)\11$/; # not match!
or
$a='\11'; print "Match\n" if "aa1" =~ /^(a)$a$/; # not match!
If it did not work like this you could not build regular expressions out of parts stored in variables.

Jenda
Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^6: How we can separate a backref from a digit?
by Serge314 (Acolyte) on Mar 21, 2011 at 10:29 UTC
    I know that variable interpolation happens before the regular expression is parsed, but I think, Perl must report regarding using a backreference with incorrect number (11).