foreach my $value (%{$key_hash{$key}}) { if (UNIVERSAL::isa($value, 'ARRAY')) { print "VALUE: @$value\n"; } else { print "VALUE: $value\n"; } }