data-dump icon indicating copy to clipboard operation
data-dump copied to clipboard

pp($value) modify original value in parameter on perl 5.28.1

Open tomas-zemres opened this issue 7 years ago • 1 comments

I have following "test-script.pl":

   use Data::Dump "pp";
   use JSON "to_json";

   my $a = ["12"];

   print "ORIG 1: ", to_json($a), "\n";
   print "PP: ", pp($a), "\n";
   print "ORIG 2: ", to_json($a), "\n";`

When I run it on perl 5.28.1, the original value in parameter is changed:

bash$ /opt/perl-5.28.1/bin/perl test-script.pl
ORIG 1: ["12"]
PP: [12]
ORIG 2: [12]

When I try same code in perl 5.26.3, the original value is not modified:

bash$ /opt/perl-5.26.3/bin/perl test-script.pl
ORIG 1: ["12"]
PP: [12]
ORIG 2: ["12"]

tomas-zemres avatar Jan 02 '19 14:01 tomas-zemres

This may be the result of https://rt.cpan.org/Ticket/Display.html?id=129922

olegwtf avatar Jun 27 '19 09:06 olegwtf