my %hash; @hash{ qw/ one two three / } = ( 1 .. 3 ); foreach ( qw/ one one three two one / ) { print $hash{$_},"\n"; } #### foreach ( qw/ one one three two one / ) { print ${@{ qw/ one two three / } = (1..3)}{$_},"\n"; }