The hash keys (when printed using Data::Dumper) were displayed within double quotes when the code was ran on different machine. On my machine, the hash keys appear without double quotes.
There are two package variables in Data::Dumper that can modify this behaviour:
$Data::Dumper::Quotekeys or $OBJ->Quotekeys([NEWVAL])
Can be set to a boolean value to control whether hash keys are quoted. A defined false value will avoid quoting hash keys when it looks like a simple string. Default is 1, which will always enclose hash keys in quotes.
$Data::Dumper::Useqq or $OBJ->Useqq([NEWVAL])
When set, enables the use of double quotes for representing string values. Whitespace other than space will be represented as [\n\t\r], "unsafe" characters will be backslashed, and unprintable characters will be output as quoted octal integers. The default is 0.
You should check the other modules you use, maybe one of them changes those package variables without resetting them, propagating the changed behaviour everywhere. BTW, to limit the effect of those variables you can use local.
{
local $Data::Dumper::Quotekeys = 0;
print Data::Dumper \%hash; # No quote keys
sub_from_other_module(); # No quote keys in the calls to Data::Dumpe
+r from the other module
}
print Data::Dumper \%hash; # Quote keys
sub_from_other_module(); # Quote keys as well
The default behaviour is neither of the cases you have observed though (it's single quotes, not doubles, not none) so that's still surprising.