Hi everyone, I am new to perl and have been going through some programs. The following code dealing with hash and array is has really confused me.
I can't understand what determines the relative ordering of elements.
In the output, why 'joe' comes between 'giggle' and 'dingbat'.
D: giggles 870 joe 2983 dingbat 33 mike -94 fred 44
@alex = ( fred => 44, 'joe' => 2983, mike => -94 );
%heather = ('This', 'will', 'actually', 'work');
%heather = @alex;
print "C: [$heather{'fred'}] [$heather{'mike'}] [$heather('joe')] ",
"[$heather{'This'}]\n";
$heather{'dingbat'} = 33;
$heather{'giggles'} = 870;
@alex = %heather;
print "D: @alex\n";
C: [44] [-94] [('joe')] []
D: giggles 870 joe 2983 dingbat 33 mike -94 fred 44