in reply to Re: Re: Interpolating an array element as a hash name.
in thread Interpolating an array element as a hash name.
Names with modifiers are an indicator that you should be using a hash instead of separate variables. Instead of $price_high, it might be an idea to use $price{high}.
How about something like ...
open STOCKS, ">", $dataFileName or die $!; my $price; PRICES: for my $category ( qw( high low average purple green ) ) { for my year ( 1990..2000 ) { last PRICES unless $price = <STOCKS>; # break loop at eof. $prices{$category}{$year} = $price; } }
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|