#!/usr/bin/perl use strict; sub display(\%) { my $i; my @ref01 = shift; foreach $i (sort keys (%{$ref01[0]})) { print "$i: ${$ref01[0]}{$i} ${$ref01[1]}{$i} ${$ref01[2]}{$i}\n"; } } my (%hash1, $j, $z); $hash1{'fruit'} = ['apple', 'orange', 'plum']; $hash1{'vegetable'} = ['leek', 'carrot', 'peas']; $z = display (%hash1); foreach $j (sort keys (%hash1)) { print "$j: $hash1{$j}[0] $hash1{$j}[1] $hash1{$j}[2]\n"; * } #### fruit: ARRAY(0x8775818) vegetable: ARRAY(0x878fea8) fruit: apple orange plum vegetable: leek carrot peas