diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-12-15 09:23:11 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-12-15 12:58:01 -0800 |
commit | 3b91d897677547cb4be755c60725a628ac435fe1 (patch) | |
tree | f953ea8cda0f7dacc3e30bde3d0e129d77965bad /lib | |
parent | 1f3063473777c9458d9e5c34697672aec5358f41 (diff) | |
download | perl-3b91d897677547cb4be755c60725a628ac435fe1.tar.gz |
Deparse: Stop =~ QR_CONST from dropping flags
Diffstat (limited to 'lib')
-rw-r--r-- | lib/B/Deparse.pm | 6 | ||||
-rw-r--r-- | lib/B/Deparse.t | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm index f1f45f8dd4..550a4a17dc 100644 --- a/lib/B/Deparse.pm +++ b/lib/B/Deparse.pm @@ -5313,6 +5313,12 @@ sub re_flags { my ($self, $op) = @_; my $flags = ''; my $pmflags = $op->pmflags; + if (!$pmflags) { + my $re = $op->pmregexp; + if ($$re) { + $pmflags = $re->compflags; + } + } $flags .= "g" if $pmflags & PMf_GLOBAL; $flags .= "i" if $pmflags & PMf_FOLD; $flags .= "m" if $pmflags & PMf_MULTILINE; diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index 740138a3e2..0ad4d00416 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -1230,6 +1230,12 @@ print /@b/; print qr/@a/; print qr/@b/; #### +# =~ QR_CONSTANT +use constant QR_CONSTANT => qr/a/soupmix; +'' =~ QR_CONSTANT; +>>>> +'' =~ /a/impsux; +#### # $lexical =~ // my $x; $x =~ //; |