comparing two hashes with different set of keys

2002-11-05 Thread naveen prabhakar
Hi I have two hashes with different set of keys,but I woul like to sort the two hashes by keys and compare their elements.could anyone tell me how to do this. I am trying to compare 'raimah' a hash with 'db2hash' I am trying to compare the first sorted element of raimah hash with the first so

Re: comparing two hashes

2002-10-16 Thread Janek Schleicher
Gary Egleton wrote: > can any one point me at how to compare two hases. You can also use a CPAN module, e.g. use Data::Compare; if (Compare(\%hash1, \%hash2)) { # hashes are equal } else { # they arent } Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: comparing two hashes

2002-10-16 Thread John W. Krahn
Gary Egleton wrote: > > Hi, Hello, > can any one point me at how to compare two hases. > > ie > > hash1 > 1 abc > 2 def > 3 ghi > > hash2 > 1 abc > 2 defzzz > 3 ghi > > I want to take the values for matching keys and see if they are the same i

Re: comparing two hashes

2002-10-16 Thread Chas Owens
On Wed, 2002-10-16 at 09:54, Egleton, Gary wrote: > Hi, > > can any one point me at how to compare two hases. > > ie > > hash1 > 1 abc > 2 def > 3 ghi > > hash2 > 1 abc > 2 defzzz > 3 ghi > > I want to take the values for matching keys and see if they are t

Re: comparing two hashes

2002-10-16 Thread Frank Wiles
x27;foobar'; This sets hash1's value at key '2' to 'foobar'. Or am I misunderstanding your question? - Frank Wiles <[EMAIL PROTECTED]> http://frank.wiles.org --------- | Subject:Re: compar

RE: comparing two hashes

2002-10-16 Thread Nikola Janceski
$_}\n"; # now prints extra keys not in both hashes } > -Original Message- > From: James Edward Gray II [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 16, 2002 11:25 AM > To: Egleton, Gary > Cc: [EMAIL PROTECTED] > Subject: Re: comparing two hashes > > &g

RE: comparing two hashes

2002-10-16 Thread Ned Cunningham
] Subject:Re: comparing two hashes .--[ Egleton, Gary wrote (2002/10/16 at 14:54:57) ]-- | | Hi, | | can any one point me at how to compare two hases

Re: comparing two hashes

2002-10-16 Thread Frank Wiles
.--[ Egleton, Gary wrote (2002/10/16 at 14:54:57) ]-- | | Hi, | | can any one point me at how to compare two hases. | | ie | | hash1 | 1 abc | 2 def | 3 ghi | | hash2 | 1 abc | 2 defzzz | 3 ghi | | I want to take the values

Re: comparing two hashes

2002-10-16 Thread James Edward Gray II
Something like: foreach (keys %hash1) { next if $hash1{$_} eq $hash2{$_}; print "$hash1{$_} $hash2{$_}\n"; } On Wednesday, October 16, 2002, at 08:54 AM, Egleton, Gary wrote: > Hi, > > can any one point me at how to compare two hases. > > ie > > hash1 > 1 abc > 2 d

comparing two hashes

2002-10-16 Thread Egleton, Gary
Hi, can any one point me at how to compare two hases. ie hash1 1 abc 2 def 3 ghi hash2 1 abc 2 defzzz 3 ghi I want to take the values for matching keys and see if they are the same if not write out the value so in the above the values in 1 and