Skip to content

Commit

Permalink
Item13181: nicely format PERL. Fingers crossed it doesn't SNAFU anyth…
Browse files Browse the repository at this point in the history
…ing else.
  • Loading branch information
Comment committed Feb 16, 2015
1 parent 26f4d39 commit f59bd37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/lib/Foswiki/Configure/Reporter.pm
Expand Up @@ -306,8 +306,11 @@ sub uneval {
local $Data::Dumper::Terse = 1;
local $Data::Dumper::Indent = $indent || 0;
$datum = Data::Dumper->Dump( [$datum] );
$datum =~ s/^\$VAR1\s*=\s*//s;
$datum =~ s/;\s*$//s;
if ( $datum =~ s/^(\$VAR\d+\s*=\s*)//s ) {
my $sp = ' ' x length($1);
$datum =~ s/^$sp//g;
}
return $datum;
}

Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Configure/Value.pm
Expand Up @@ -402,7 +402,7 @@ sub encodeValue {
return $value;
}
elsif ( ref($value) ) {
return Foswiki::Configure::Reporter::uneval($value);
return Foswiki::Configure::Reporter::uneval( $value, 2 );
}
elsif ( $this->{typename} eq 'OCTAL' ) {
return sprintf( '0%o', $value );
Expand Down

0 comments on commit f59bd37

Please sign in to comment.