in reply to Platform Dependence observed in Perl - Hash keys have different format
The hash keys (when printed using Data::Dumper) were displayed within double quotes ...
Please show, don't tell - post some sample input and the actual Data::Dumper output in <code> tags. See also How do I post a question effectively?
Your description is a bit unclear on whether you mean (foo=>3) vs. ("foo"=>3), or ('foo'=>3) vs. ('"foo"'=>3). If it's the former, then Eily has already shown you the variables that control that behavior, although I would have to add that Data::Dumper is a debugging aid and not the best thing to output strings in a reliably consistent format - as long as its output is in Perl syntax it's doing its job.
On the other hand, if it's the latter example, which I am thinking is the case, then I fully agree with Corion's post - the fact that you have to decide between commas and semicolons as separators means you're dealing with CSV files in different formats, so it's reasonable to assume that one input file might say foo;bar;quz and the other "foo","bar","quz". Using Text::CSV will take care of that for you.
Just to point out one other thing: Your BEGIN { my @script_path_dirs = split('/',abs_path($0)); ... can, as far as I can tell, be replaced by the slightly more reliable use FindBin; use lib $FindBin::Bin;.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Platform Dependence observed in Perl - Hash keys have different format
by rkabhi (Acolyte) on Mar 04, 2017 at 17:00 UTC | |
by huck (Prior) on Mar 04, 2017 at 18:55 UTC |