%array = ( "100", "Green", "200", "Orange");
while (($key, $value) = each(%array)) {
print("$key = $value\n");
}
Acc. to the functionality of above code, each() function used on associative array, This program should print the following:
100 = Green
200 = Orange
But on running it on my machine, it returns:
200 = Orange
100 = Green
On adding more key, value pairs it gives different results which I cannot find a pattern for.
This same code when run on other machine with different perl running on it works. I really need to know why this does not come in the order as it is in the array.