%loves = ( "Tammy" => "Bob", "Susan" => "Bill", "Patricia" => "Marko" ); %girls_house = ( "Tammy" => 'Schenectady, NY', 'Susan' => 'Yonkers, NY', 'Patricia' => 'Kinderhook, NY' ); while (my ($girl, $boy) = each %loves) { print "$girl loves $boy \n"; } my %girlfriend = reverse %loves; use Data::Dumper; print Dumper \%girlfriend; for my $boy (keys %girlfriend) { print "$boy loves $girlfriend{$boy} \n"; } use Data::Dumper; print Dumper \%girlfriend; for my $boy (keys %girlfriend) { print "$boy loves $girlfriend{$boy} \n"; } %vehicle = ( "Marko" => 'Station Wagon', 'Bill' => 'motorcycle', 'Bob' => 'Volvo' ); for my $boy (keys %vehicle) { print "It is Valentine's day and $boy drove his $vehicle{$boy} and went to visit $girlfriend{$boy} in $girls_house{$girlfriend{$boy}} \n"; } #### Patricia loves Marko Susan loves Bill Tammy loves Bob $VAR1 = { 'Bob' => 'Tammy', 'Marko' => 'Patricia', 'Bill' => 'Susan' }; Bob loves Tammy Marko loves Patricia Bill loves Susan It is Valentine's day and Bob drove his Volvo and went to visit Tammy in Schenectady, NY It is Valentine's day and Marko drove his Station Wagon and went to visit Patricia in Kinderhook, NY It is Valentine's day and Bill drove his motorcycle and went to visit Susan in Yonkers, NY