my @names = qw(A B C D); for(my $i=0; $i<4; $i++) { my @$names[$i] = ($i); }