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 def

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 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 Nikola Janceski
; # 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 Something like: foreach (keys %hash1

Re: comparing two hashes

2002-10-16 Thread Frank Wiles
'; 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: comparing two hashes | | .--[ Egleton, Gary

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 the same if not

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 if not write out

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