hash comparison
Hello
is there a module, or what is the best way to compare two
hashes and have the differences ?
something like
my %newab = compare(%a,%b)
in %newab i need the values that are in %a but not in %b
and vicevers
my %newba = compare(%b,%a)
thank you
Bye
Re: hash comparison
In article <A4mof.86634$65.2505133 [at] twister1.libero.it>, Bill
<bill [at] coldmail.com> wrote:
> Hello
>
> is there a module, or what is the best way to compare two
> hashes and have the differences ?
>
> something like
>
> my %newab = compare(%a,%b)
>
> in %newab i need the values that are in %a but not in %b
> and vicevers
>
> my %newba = compare(%b,%a)
Check out List::Compare and use it on the keys of your hashes.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Re: hash comparison
"Bill" <bill [at] coldmail.com> wrote in message
news:A4mof.86634$65.2505133 [at] twister1.libero.it...
> Hello
>
> is there a module, or what is the best way to compare two
> hashes and have the differences ?
>
> something like
>
> my %newab = compare(%a,%b)
>
> in %newab i need the values that are in %a but not in %b
> and vicevers
>
See the entry that deal with this problem in perlfaq4: How can I get the
unique keys from two hashes?
Matt