in reply to Changing name of ARRAY in each iteration

It looks like you're trying to dynamically create a new array name, e.g. @energyA, @energyB.

You should probably make it a hash of array references.

push @{$energy{$x}}, $Winenergy{$ell};

This way, you'll have %energy, which would contain references to the arrays, for example, $energy{'A'} and $energy{'B'}, etc. Then you could simply dereference them, e.g. @{$energy{'A'}}), to access the elements.

Hope this helped,
-v.

"Perl. There is no substitute."