Skip to content

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

@tomas-zemres

Description

@tomas-zemres

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"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions