Created
July 14, 2017 02:07
-
-
Save petdance/0f1b9e37750cd443bc4bad4b467e7454 to your computer and use it in GitHub Desktop.
Why does \Q not work here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use warnings; | |
use strict; | |
use 5.010; | |
use Data::Dumper; | |
my $re = '\Qfoo('; | |
warn Dumper( $re ); | |
my $qr1 = qr/\Qfoo(/; | |
warn Dumper( $qr1 ); | |
my $qr2 = qr/$re/; | |
warn Dumper( $qr2 ); | |
[21:07:00] (SVN) turkey:~ $ perl foo | |
$VAR1 = '\\Qfoo('; | |
$VAR1 = qr/foo\(/; | |
Unmatched ( in regex; marked by <-- HERE in m/\Qfoo( <-- HERE / at foo line 15. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment