my $type = ''; for my $entry (@$array) { if ( $entry->{type} ne $type ) { $type = $entry->{type}; print $type."\n"; } print "\t$entry->{name}\n"; }