in reply to A hash of a range of another hash

When I saw this, I tried to solve this using the code below. This is very similar to the code presented by 'Anonymous Monk'. #!/usr/bin/perl use strict; use Data::Dumper; my @range = (5 .. 8); my %hash_1 = map { $_ => $_ } (1 .. 10); my %hash_2 = map { $_ => $hash_1{$_} } @range; print Dumper \%hash_2;