http://www.perlmonks.org?node_id=1029966


in reply to Understading array of hashes

warnings gives you a hint with: Useless use of hash element in void context at fluff.pl line 43. In your for loop, you never actually assign anything, so it is a no-op. You get something very close if you uncomment line 41, so you should probably just concentrate on how to modify your output. Essentially, if you don't want to output something, then don't print it:
my %hash; $hash{$_->{'type'}} {$_->{'name'}} = $_->{'reference'} for @$array; #$hash{$_->{'type'}}{ $_->{'name'} }for @$array; print "Results:\n"; for my $k1 (sort keys %hash) { print " $k1:\n"; for my $k2 (sort keys %{$hash{$k1}}) { print " $k2\n"; } }

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.