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

    Sorry for my delayed response and thanks for so many useful replies.

    Thanks Corion for your hint. The file Pin_Values.txt actually has a csv format and the tool opens the file using soffice. I now realize that I missed to check if CSV file (Pin_Values.txt) is being processed correctly by soffice on two machines. This could possibly be the reason since the machines might have different soffice setup. I can confirm this by Tuesday as I am currently out and not having access to my system.

    Hi haukex, thanks for your tips. Sorry for missing to go through process in pressure to resolve the error. To answer your query, I was referring to ('foo'=>3) vs. ('"foo"'=>3).

    Thanks Eily for sharing useful info about Hash key behavior. This will definitely help me in future. However, I did not change any settings that way and therefore I now suspect soffice to be the issue here.