in reply to hash of arrays or separate hashes?

Since hash values can only contain a scalar value you can't actually hold two values. Instead, what you can do is store an array of two values e.g
my %hash = ( Alpha => [ 37 [0,0,4,26,0,7] ], Beta => [ 40, [1,38,0,0,0,1], ], Gamma => [ 3 [1,1,0,0,0,1], ], );
See. perldsc for more information.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: hash of arrays or separate hashes?
by Anonymous Monk on Mar 04, 2004 at 16:50 UTC
    Monks I need all your help again, sorry I new on this..
    Before I use to countfreq for an element using $Elementsfreq{$Element}++; Now to increment the count, do I have to have another variable?, Could + you please tell me what is wrong with the following?: $countElements++; %Elementsfreq = ($Element => [$countElements, [ 0..$index ] ]); $bigramfrequency{$bigram}[0]++; $bigramfrequency{$bigram}[1][$position]++;
    Thanks!!
      oops I am counting twice.. Please disregard the $countElement++. But Still is the rest ok?