my $local_foo = ${"foo_$i"} #### my @fee; for (0 .. $MAX_ROWS){ push @fee, $foo[$_]; } #### my @fee = @foo[0 .. $MAX_ROWS];