Commit c5581fcc authored by Leo Gordon's avatar Leo Gordon
Browse files

secutiry: make sure stringify() always produces perl-parsable structures, so...

secutiry: make sure stringify() always produces perl-parsable structures, so that global settings of Data::Dumper do not affect its results (thanks to Uma and Matthieu for reporting)
parent e83158ae
......@@ -59,11 +59,12 @@ our @EXPORT_OK = qw( stringify destringify dir_revhash parse_cmdline_options fin
sub stringify {
my $structure = pop @_;
local $Data::Dumper::Indent = 0; # we want everything on one line
local $Data::Dumper::Terse = 1; # and we want it without dummy variable names
local $Data::Dumper::Sortkeys = 1; # make stringification more deterministic
local $Data::Dumper::Quotekeys = 1; # conserve some space
local $Data::Dumper::Useqq = 1; # escape the \n and \t correctly
local $Data::Dumper::Indent = 0; # we want everything on one line
local $Data::Dumper::Terse = 1; # and we want it without dummy variable names
local $Data::Dumper::Sortkeys = 1; # make stringification more deterministic
local $Data::Dumper::Quotekeys = 1; # conserve some space
local $Data::Dumper::Useqq = 1; # escape the \n and \t correctly
local $Data::Dumper::Pair = ' => '; # make sure we always produce Perl-parsable structures, no matter what is set externally
return Dumper($structure);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment