for my $user (sort keys %hoh) { my @websites = @{ $hoh{$user}{'Website'} }; my @types = @{ $hoh{$user}{'type'} }; # assume we have the same number of each? unless (scalar(@websites) == scalar(@types)) { die "number of websites is different from number of types!"; } print "$user :\n"; for ( my $i=0; $i < scalar(@websites); ++$i) { print " $websites[$i]\n"; print " $types[$i]\n"; } print "\n"; }