diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-10-12 22:29:04 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-10-12 22:55:59 -0700 |
commit | b68108d9b5245170bc0844ad4bded511ab7cca6a (patch) | |
tree | 59ffc79698edbd5a3e2f7b4046bac3529488c472 /t | |
parent | 2203fb5a8b3178b6188538e4c811106ceb721132 (diff) | |
download | perl-b68108d9b5245170bc0844ad4bded511ab7cca6a.tar.gz |
Handle cow $_ in @INC filter
Setting $_ to a copy-on-write scalar in an @INC filter causes the
parser to modify every other scalar sharing the same string buffer.
It needs to be forced to a regular scalar before the parser sees it.
Diffstat (limited to 't')
-rw-r--r-- | t/op/incfilter.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/op/incfilter.t b/t/op/incfilter.t index 582b691d82..6227c4ac37 100644 --- a/t/op/incfilter.t +++ b/t/op/incfilter.t @@ -13,7 +13,7 @@ use strict; use Config; use Filter::Util::Call; -plan(tests => 144); +plan(tests => 145); unshift @INC, sub { no warnings 'uninitialized'; @@ -216,6 +216,11 @@ do [\'pa', \&generator_with_state, "pass('And return multiple lines');\n", ]] or die; +@origlines = keys %{{ "1\n+\n2\n" => 1 }}; +@lines = @origlines; +do \&generator or die; +is $origlines[0], "1\n+\n2\n", 'ink filters do not mangle cow buffers'; + # d8723a6a74b2c12e wasn't perfect, as the char * returned by SvPV*() can be # a temporary, freed at the next FREETMPS. And there is a FREETMPS in # pp_require |