in reply to Using non-scalar constructs in foreach loops

The index variable of a foreach loop is locally aliased to each of the elements of the list, in turn. That is not the same as being assigned to each value; instead, it's more like being a reference that is implicitly dereferenced. The index variable is just another name for whatever is in the list. The actual data you want to work with must be in the list. Like
foreach my $i (@tstary[1,1,1]) { # or (($tstary[1])x3) ++$i; print join(':', @tstary), "\n"; }

Caution: Contents may have been coded under pressure.