my $i=0; while ($i<$#group) { $hash{$group[$i]}=$group[$i+1]; $i+=2; }