my @single = grep {keys (%{$bigList{$_}}) == 1} keys %bigList; my @multi = grep {keys (%{$bigList{$_}}) > 1} keys %bigList; for my $one (@single) { print "$one ", join ', ', sort {$a <=> $b} keys %{$bigList{$one}}; print "\n"; } print "\n\nClients with multiple phone numbers:\n\n"; for my $one (@multi) { print "$one ", join ', ', sort {$a <=> $b} keys %{$bigList{$one}}; print "\n"; } #### Gloria Simpson 8215449341 Sam Burr 4550327 Freddie Sonere 4429089 Felix Harris 4333448711 Bob Cartwright 8219870089 Clients with multiple phone numbers: Bob Wilson 3324549932, 8888212248 Wanda Smith 4449721, 3324329887