Krambambuli has asked for the wisdom of the Perl Monks concerning the following question:
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; }
solves the issue, but I'm not sure I understand why exactly.my $d = Data::Dumper->new([$newConf->{$var}], \[*value]);
|
---|
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 |