--- Ravi Channavajhala <[EMAIL PROTECTED]> wrote:
> Hi,

Howdy.

> Does anyone have a nifty way to do a sort and comparison
> of two or more hash keys with multiple values per key? 
> I am building a hash with
> 
> push (@{$a{$b}},$c);

Okay; %a is the hash, and each entry in the hash is an array, named
with the value of $b at the time of the push(). $c is the value you're
pushing onto the appropriate stack. I'm with you so far.

> $b keeps changing, lets say in first instance it is "1" and
> "2" in second instance, and each instance has multiple values,

So every entry has more than one element, but not a consistent number.

> e.g, instance "1" has "c1 c2 c3" and instance "2" has "c1 c2 c3

No. $a{1} might have ('c1','c2','c3'), or it's first element might be 
"c1 c2 c3", but for clarity's sake, let's say ('c1','c2','c3'). These
three values are the elements of the array stored at $a{1}, right?
The $a{2} is ('c1','c2','c3','c4','c5') ?

> c4 c5".  What's the easiest way to iterate through the hash and
> compare each instance values and print the differences?  Thanks
> for any answers.  In the above case, I like to see c4 and c5 as
> the values different from instance "1" to instance "2".

Hmm.

That sounds pretty specific, though I'd expect that you'd want more
flexibility. Do you just want to walk the limbs of your "tree" and see
which "leaves" differentiate? That could be implemented so many ways,
that are *so* different. You probably need to post more specific
examples, maybe some of the code that you have. There may be a much
easier way to accomplish your end goal. What is it that you're actually
trying to get done in the end?

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to