#!/usr/bin/perl -w #use strict; my %family = ( 'parents' => ['Barbie', 'Ken'], 'siblings' => ['John', 'Robert'], 'wife' => ["Heather"], 'pets' => ["Miles", "Vanilla", ["Dallas", "some cat"], ["snoopy", "woodstock"] ], 'inlaws' => [ ["Luke", "Leigh"], ["Carol", "Jack"] ], 'sisinlaw' => ["Lucy"], 'broinlaw' => ["Linus", "Pig Pen"], 'friends' => ["Jack", "Jill", "Peter", "Mac"], 'coworkers'=> ["sammy", "colin", "dave"] ); for my $label ( sort keys(%family) ) { my @names = $family{$label}; print "$label\n"; for my $name ( 0 .. $#names ) { for my $names ( 0 .. $#{ $family{$label} } ) { print "\t$family{$label}->[$names]\n"; for my $x ( 0 .. $#{ $family{$label}->[$names] } ) { print "\t$family{$label}->[$names][$x]\n "; #this is where Im stuck. Id like to # just print out the names in the # arrays } } } }