http://www.perlmonks.org?node_id=998301

truthseeker66 has asked for the wisdom of the Perl Monks concerning the following question:

When I run this script why do I get the keys and values not in order?
Thank you,
#!/usr/bin/perl use strict; use warnings; my%hash1 = ("a",1,"b",2,"c",3,"d",4); while (my@values = each(%hash1)){ print "The key/value pair is @values \n"; }

C:\JPARK\JPERL>test.pl
The key/value pair is c 3
The key/value pair is a 1
The key/value pair is b 2
The key/value pair is d 4