#!/usr/bin/perl -w use strict; my %valid=( first => [1..8], second => [1..3], third => [1..6] ); for(keys %valid){ print "the length of \$valid{$_} is ", scalar @{$valid{$_}}, "\n"; } #### the length of $valid{first} is 8 the length of $valid{third} is 6 the length of $valid{second} is 3