in reply to Re: Hash newbie
in thread Hash newbie

ikegami explained that this uses a hash slice. He also showed an equivalent snippet that has the same effect as yours. But I'd like to show an equivalent snippet that might help you understand how the hash slice is doing its job:

my %h = (); # @h{@FIELDS} = @row; ($h{$FIELDS[0]}, $h{$FIELDS[1]}, $h{$FIELDS[2]}, ...) = ( $row[0] , $row[1] , $row[2] , ...); $result = \%h;

As you can see, a hash slice is simply a convenient syntax for doing something that is not altogether very complicated. Hopefully this helps you understand it.