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
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
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
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
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
$_}\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
]
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
.--[ 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
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
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
10 matches
Mail list logo