Krambambuli has asked for the wisdom of the Perl Monks concerning the following question:
Within BackupPC::Storage::Text, there is some code like
Replacing the line referring Data::Dumper with
In particular, I would like to understand if it's BackupPC doing something that it shouldn't when using [*value], or if it is Data::Dumper that broke the rules by doing things differently now.
(Later edit) Looks like the correct question is like
should [*value] be a list or an arrayref?
This works fine for older versions of Data::Dumper, but fails for newer ones.if ( exists($newConf->{$var}) ) { my $d = Data::Dumper->new([$newConf->{$var}], [*va +lue]); $d->Indent(1); $d->Terse(1); $d->Sortkeys(1); my $value = $d->Dump; $value =~ s/(.*)\n/$1;\n/s; $contents .= "\$Conf{$var} = " . $value; $done->{$var} = 1; }
Replacing the line referring Data::Dumper with
solves the issue, but I'm not sure I understand why exactly.my $d = Data::Dumper->new([$newConf->{$var}], \[*value]);
In particular, I would like to understand if it's BackupPC doing something that it shouldn't when using [*value], or if it is Data::Dumper that broke the rules by doing things differently now.
(Later edit) Looks like the correct question is like
should [*value] be a list or an arrayref?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: BackupPC or Data::Dumper playing foul...?
by hv (Prior) on Apr 08, 2022 at 17:47 UTC | |
by Krambambuli (Curate) on Apr 08, 2022 at 18:20 UTC | |
by hv (Prior) on Apr 08, 2022 at 20:41 UTC | |
by Krambambuli (Curate) on Apr 08, 2022 at 21:55 UTC | |
by dsheroh (Monsignor) on Apr 11, 2022 at 07:20 UTC |
Back to
Seekers of Perl Wisdom