in reply to Hashes and Arrays - Selecting a memory structure
My 2 cents.....I'm barely a Monk's novice's assitant helper (in perl terms)...but I would try a hash with an anonymous array...since each item has a unique key value (DOW, SP500, Russel2000) and discrete values. The anonymous array allows you to associate multiple values with a single hash key. It's also more intiutive.<\p>
Accessing the 7th value is straight forward from there. The hash can be sorted based on the 7th value.<\p>
#Begin code example my %hash = ( 'Dow' , [99,123,345,567,678, 756, 202], 'SP500', [88,55,55,677,843, 987, 345], 'Russell1000',[456,788,990,889,876,234,456], ); #access 7th value print $hash{'Dow'}[7],"\n"; #should equal 202
|
---|