use strict; use warnings; my %foo; @foo{1..3} = (); print keys %foo; @foo{qw/1 2 3/} = (); print keys %foo;