my $number = 2; my $word = ${my %x; @x{qw(1 2 3)} = qw(one two three); \%x}{$number};