Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ordering of mappings and application stable #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sputtene
Copy link

Perl 5.8.1 added hash randomisation (see
https://metacpan.org/release/JHI/perl-5.8.1/view/pod/perldelta.pod#Hash-Randomisation).

The effect is that multiple invocations of keys %hash return the hash keys in
different ordering, even between separate runs of the script with the same
inputs.

As a result, running the script multiple times, yielded non-identical XML
output, since the order of the mappings and application lists is different
every time.

By first sorting the hash keys for the mapping and application hashes before
iterating over them, multiple runs of the script with the same inputs result in
identical output.

Perl 5.8.1 added hash randomisation (see
https://metacpan.org/release/JHI/perl-5.8.1/view/pod/perldelta.pod#Hash-Randomisation).

The effect is that multiple invocations of `keys %hash` return the hash keys in
different ordering, even between separate runs of the script with the same
inputs.

As a result, running the script multiple times, yielded non-identical XML
output, since the order of the mappings and application lists is different
every time.

By first sorting the hash keys for the mapping and application hashes before
iterating over them, multiple runs of the script with the same inputs result in
identical output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant