In non-interpolating regex constructs like m'',
double-quote style backslash sequences like \n or
\x0A are nevertheless interpreted.
In interpolating regex constructs, when interpolating
a variable into the regex, double-quote backslash
sequences inside the variable are also interpolated (again).
This case can be rather confusing, because if the
variable was assigned from a double-quoted string, the
the DQ sequences are interpreted twice (see code snippet).
This doesn't seem to be the right behaviour, as \n, \r, \x
and so on aren't RE backslash sequences, but double-quote
backslash sequences. Perldoc perlop (gory details...) seems
to indicate that only RE backslash sequences like \b, \z, ...
should be interpreted at that stage, because DQ sequences have
already been handled by the quote-like parsing of the regex
constructor (in case of m//) or shouldn't be handled (in case
If the current behaviour is indeed intended, the documentation
should be clarified.
Migrated from rt.perl.org#21491 (status was 'resolved')
Searchable as RT21491$
The text was updated successfully, but these errors were encountered: