in reply to Changing name of ARRAY in each iteration
You still have uninitialized variables (eg. "dinu_r"). Besides that, I don't know what your input file looks like.
But perhaps this will help to give you an idea about what the other monks are strongly suggesting; namely, that you use a better data structure (eg. a hash of arrays) instead of symbolic references:
# Near the top of the code my %energy; # Later on ... foreach my $el1(sort{$a <=> $b} keys %Winenergy) { # push(@energy.$x , $Winenergy{$el1}); #LINE C # print OUT "$el1\t $Winenergy{$el1}\n"; $energy{"energy$x"} ||= [ ]; # Initialize a +rray ref push @{$energy{"energy$x"}}, $Winenergy{$el1}; # Save to appr +opriate array }
Does that help you to get started?
|
|---|