Hi,
I have just started learning PERL.
below is the code i have written , i am expecting the same order that of array when i print the contents.
but the output was
29
25
Michael
29
Walter
34
Donny
25
Sobzchak
30
can some body please clarify the behaviour of arrays/foreach.
%ages = ("Sobzchak",30,
"Michael", 29,
"Walter",34,
"Donny",25,
);
print $ages{"Michael"}."\n";
print $ages{"Donny"}."\n";
@info = %ages;
foreach $item ( @info ) {
print $item."\n";
}