Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Data-Printer CPAN distribution.

Report information
The Basics
Id: 96019
Status: resolved
Priority: 0/
Queue: Data-Printer

People
Owner: Nobody in particular
Requestors: tai [...] pplus.co.nz
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Hash Key Sorting
Date: Wed, 28 May 2014 14:16:10 +1200
To: <bug-Data-Printer [...] rt.cpan.org>
From: "Tai Paul" <tai [...] pplus.co.nz>
Hello, Please find below a script that produces correct or mangled hash sort results depending on the operating system or version number of Data::Printer. Unfortunately the results are inconclusive as to whether the problem is in Data::Printer 0.35 or Fedora. As I have no other linux versions and lack the relevant skills I am sending this bug report to you. Thank you for an otherwise excellent module. Tai Paul Results Summary Table OS Perl version Data Printer Version Result Fedora 17 perl v5.14.4 0.35 Mangled Fedora 20 perl 5.18.2 0.35 Mangled Windows 7 perl v5.14.2 0.30 Correct Windows 8 Perl v5.16.2 0.30 Correct Script #!/usr/bin/perl -w use Data::Printer output => 'stdout' ; use POSIX qw(setlocale LC_NUMERIC); print q{LC_NUMERIC = [} . setlocale(LC_NUMERIC) . "]\n"; print q{Data::Printer::$VERSION = [} . $Data::Printer::VERSION . "]\n"; print q{Operating System [} . $^O . "]\n"; print q{Perl Version [} . $^V . "]\n"; my $hash = { MOD_BASE_COLOR => "Line 7 after sort", MOD_BAS_TASTE => "Line 6 after sort", MOD_BAS_FLAVOR => "Line 5 after sort", MOD_APPLICATION_NAME => "Line 4 after sort", MOD_APP_NAME => "Line 3 after sort", MOD_APP_LONG_NAME => "Line 2 after sort", MOD_APP_DOMAIN => "Line 1 after sort", }; p $hash; Output from Windows 7; LC_NUMERIC = [C] Data::Printer::$VERSION = [0.3] Operating System [MSWin32] Perl Version [v5.14.2] \ { MOD_APP_DOMAIN "Line 1 after sort", MOD_APP_LONG_NAME "Line 2 after sort", MOD_APP_NAME "Line 3 after sort", MOD_APPLICATION_NAME "Line 4 after sort", MOD_BAS_FLAVOR "Line 5 after sort", MOD_BAS_TASTE "Line 6 after sort", MOD_BASE_COLOR "Line 7 after sort" } Output from Windows 8 LC_NUMERIC = [C] Data::Printer::$VERSION = [0.3] Operating System [MSWin32] Perl Version [v5.16.3] \ { MOD_APP_DOMAIN "Line 1 after sort", MOD_APP_LONG_NAME "Line 2 after sort", MOD_APP_NAME "Line 3 after sort", MOD_APPLICATION_NAME "Line 4 after sort", MOD_BAS_FLAVOR "Line 5 after sort", MOD_BAS_TASTE "Line 6 after sort", MOD_BASE_COLOR "Line 7 after sort" } Output from Fedora 17 LC_NUMERIC = [C] Data::Printer::$VERSION = [0.35] Operating System [linux] Perl Version [v5.14.4] \ { MOD_APP_DOMAIN "Line 1 after sort", MOD_APPLICATION_NAME "Line 4 after sort", MOD_APP_LONG_NAME "Line 2 after sort", MOD_APP_NAME "Line 3 after sort", MOD_BASE_COLOR "Line 7 after sort", MOD_BAS_FLAVOR "Line 5 after sort", MOD_BAS_TASTE "Line 6 after sort" } Output from Fedora 20 LC_NUMERIC = [C] Data::Printer::$VERSION = [0.35] Operating System [linux] Perl Version [v5.18.2] \ { MOD_APP_DOMAIN "Line 1 after sort", MOD_APPLICATION_NAME "Line 4 after sort", MOD_APP_LONG_NAME "Line 2 after sort", MOD_APP_NAME "Line 3 after sort", MOD_BASE_COLOR "Line 7 after sort", MOD_BAS_FLAVOR "Line 5 after sort", MOD_BAS_TASTE "Line 6 after sort" }

Message body is not shown because it is too large.

Hi, Tai! Thank you very much for using Data::Printer and for taking the time to file this issue - specially with a test case! I really appreciate this. Also, I'm really sorry it took me so long to reply - I have moved all issues to Github and forgot to check RT. I *think* the issue is fixed in the most recent version of Data::Printer (0.99_007, also on github master branch - soon to be 1.0): perl rt96019.pl LC_NUMERIC = [en_US.UTF-8] Data::Printer::$VERSION = [0.99_007] Operating System [darwin] Perl Version [v5.24.1] { MOD_APP_DOMAIN "Line 1 after sort", MOD_APP_LONG_NAME "Line 2 after sort", MOD_APP_NAME "Line 3 after sort", MOD_APPLICATION_NAME "Line 4 after sort", MOD_BAS_FLAVOR "Line 5 after sort", MOD_BAS_TASTE "Line 6 after sort", MOD_BASE_COLOR "Line 7 after sort" } So I'm marking the ticket as resolved. If you ever bump into it again, please let me know! Your name has been added to the contributor's list :) Thanks again, garu On Tue May 27 22:16:20 2014, tai@pplus.co.nz wrote: Show quoted text
> Hello, > > Please find below a script that produces correct or mangled hash sort > results depending on the operating system or version number of > Data::Printer. > > Unfortunately the results are inconclusive as to whether the problem is in > Data::Printer 0.35 or Fedora. As I have no other linux versions and lack > the relevant skills I am sending this bug report to you. > > Thank you for an otherwise excellent module. > > Tai Paul > > > Results Summary Table > > OS > Perl version > Data Printer Version > Result > > Fedora 17 > perl v5.14.4 > 0.35 > Mangled > > Fedora 20 > perl 5.18.2 > 0.35 > Mangled > > Windows 7 > perl v5.14.2 > 0.30 > Correct > > Windows 8 > Perl v5.16.2 > 0.30 > Correct > > Script > > > #!/usr/bin/perl -w > > use Data::Printer output => 'stdout' ; > use POSIX qw(setlocale LC_NUMERIC); > print q{LC_NUMERIC = [} . setlocale(LC_NUMERIC) . "]\n"; > print q{Data::Printer::$VERSION = [} . $Data::Printer::VERSION . "]\n"; > print q{Operating System [} . $^O . "]\n"; > print q{Perl Version [} . $^V . "]\n"; > > my $hash = { > MOD_BASE_COLOR => "Line 7 after sort", > MOD_BAS_TASTE => "Line 6 after sort", > MOD_BAS_FLAVOR => "Line 5 after sort", > MOD_APPLICATION_NAME => "Line 4 after sort", > MOD_APP_NAME => "Line 3 after sort", > MOD_APP_LONG_NAME => "Line 2 after sort", > MOD_APP_DOMAIN => "Line 1 after sort", > }; > > p $hash; > > > Output from Windows 7; > > LC_NUMERIC = [C] > Data::Printer::$VERSION = [0.3] > Operating System [MSWin32] > Perl Version [v5.14.2] > \ { > MOD_APP_DOMAIN "Line 1 after sort", > MOD_APP_LONG_NAME "Line 2 after sort", > MOD_APP_NAME "Line 3 after sort", > MOD_APPLICATION_NAME "Line 4 after sort", > MOD_BAS_FLAVOR "Line 5 after sort", > MOD_BAS_TASTE "Line 6 after sort", > MOD_BASE_COLOR "Line 7 after sort" > } > > > Output from Windows 8 > > LC_NUMERIC = [C] > Data::Printer::$VERSION = [0.3] > Operating System [MSWin32] > Perl Version [v5.16.3] > \ { > MOD_APP_DOMAIN "Line 1 after sort", > MOD_APP_LONG_NAME "Line 2 after sort", > MOD_APP_NAME "Line 3 after sort", > MOD_APPLICATION_NAME "Line 4 after sort", > MOD_BAS_FLAVOR "Line 5 after sort", > MOD_BAS_TASTE "Line 6 after sort", > MOD_BASE_COLOR "Line 7 after sort" > } > > Output from Fedora 17 > > > LC_NUMERIC = [C] > Data::Printer::$VERSION = [0.35] > Operating System [linux] > Perl Version [v5.14.4] > \ { > MOD_APP_DOMAIN "Line 1 after sort", > MOD_APPLICATION_NAME "Line 4 after sort", > MOD_APP_LONG_NAME "Line 2 after sort", > MOD_APP_NAME "Line 3 after sort", > MOD_BASE_COLOR "Line 7 after sort", > MOD_BAS_FLAVOR "Line 5 after sort", > MOD_BAS_TASTE "Line 6 after sort" > } > > > Output from Fedora 20 > > LC_NUMERIC = [C] > Data::Printer::$VERSION = [0.35] > Operating System [linux] > Perl Version [v5.18.2] > \ { > MOD_APP_DOMAIN "Line 1 after sort", > MOD_APPLICATION_NAME "Line 4 after sort", > MOD_APP_LONG_NAME "Line 2 after sort", > MOD_APP_NAME "Line 3 after sort", > MOD_BASE_COLOR "Line 7 after sort", > MOD_BAS_FLAVOR "Line 5 after sort", > MOD_BAS_TASTE "Line 6 after sort" > } > >