%group = ( 'forest', 'tree', 'crowd', 'person', 'fleet', 'ship' );
while ( ( $key, $value ) = each(%group) ) {
print "A $value is part of a $key.\n";
}
This is the code and the output is this
A person is part of a crowd.
A tree is part of a forest.
A ship is part of a fleet.
why don't I get the output according to the order I have given in the array?