use Language::Functional 'zip'; for( qw/ one one three two one / ) { print +{@{zip([qw/one two three/],[1..3])}}->{$_}, $/; } __output__ 1 1 3 2 1