#!/usr/bin/perl use strict; use warnings FATAL => qw(all); my @ray = qw(a b c d e f); my %hash = @ray[0..3]; while (my ($k, $v) = each (%hash)) { print "$k = $v\n"; }