#!/usr/bin/perl use warnings; use strict; my %ManagerInCharge = ( 200610 => { 1 => "jane", 2 => "john", 3 => "joe", 4 => "frank", }, 200701 => { 1 => "gunder", 2 => "abel", 3 => "frank", }, ); my $month = "200701"; # # If you need the keys assigned, then the statement # my @slice = keys %{$ManagerInCharge{$month}} # is enough. # my @slice = map { $ManagerInCharge{$month}{$_} } ( keys %{$ManagerInCharge{$month}} ); for (@slice) { print "value is $_\n"; } #### C:\Code>perl assign_slice.pl value is gunder value is frank value is abel