in reply to loop thru 3-element array?

In my own version of List::Util I have this subroutine:

sub group { my $n = shift; map [ @_[$_*$n .. $_*$n + $n - 1] ] => 0 .. $#_ / $n; }
For your example, it would be used as
for (group(3, @dynval3)) { my ($newname, $name, $val) = @$_; ... }

ihb

Read argumentation in its context!