in reply to Re^3: Human-readable serialization formats other than YAML?
in thread Human-readable serialization formats other than YAML?

I was under the impression that the order of unsorted hash keys is not even guaranteed for *each invocation* of perl for any version of perl in any environment ...

# Perl 5.8.7, perldoc -f keys keys HASH ... The keys are returned in an apparently random order. The actual random order is subject to change in future versions of perl, but it is guaranteed to be the same order as either the "values" or "each" function produces (given that the hash has not been modified). Since Perl 5.8.1 the ordering is different even between different runs of Perl for security reasons (see "Algorithmic Complexity Attacks" in perlsec). ...

... ok, at least not since version 5.8.1.

Replies are listed 'Best First'.
Re^5: Human-readable serialization formats other than YAML?
by tachyon-II (Chaplain) on Apr 24, 2008 at 01:18 UTC

    It bit me back in the 5.6 days in the context of cross platform and different perl versions with stringified hash comparisons in test.t files. The data was the same, but the order was different so the tests failed. At least nowadays it looks like it should bite you immediately instead of after uploading your pride and joy to CPAN only to have it fail tests here, there, and everywhere! Thanks for the info.