use strict; use warnings; my %hash; for ( 1 .. 20 ) { $hash{$_}=$_ } for ( 1 .. 10 ) { print"values: ";print values %hash;print"\n"; print"keys: ";print keys(%hash);print"\n"; print "\n"; }