use strict; use warnings; # two sample entries, notice i moved this comment my %modhash = ( 'first:second:third' => [ qw(bob bill bo) ], 'Canada:USA:China' => [ qw(beaver eagle Mao) ], ); for my $key ( keys %modhash ) { my @subkeys = split( /:/, $key ); for my $i (0..$#subkeys) { print "subkey-> $subkeys[$i]\t", "subvalue-> $modhash{$key}->[$i]\n"; } print "\n"; }