Re: How to compare hashes to find matching keys with conflicting values.

2006-02-03 Thread John Doe
Angus am Freitag, 3. Februar 2006 10.13: > Joe, > > Thank you for taking the time to explain this bit of code. I have spent > some time trying to understand the ternary operator (?:) this evening and I > think it is making more sense. In the past I have seen this operator and > moved on in favor

RE: How to compare hashes to find matching keys with conflicting values.

2006-02-03 Thread Angus
t: Thursday, February 02, 2006 3:26 AM To: beginners@perl.org Subject: Re: How to compare hashes to find matching keys with conflicting values. Angus am Donnerstag, 2. Februar 2006 10.14: > John, Hello Angus > Well that works perfect now my issue is to understand what you have > provid

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-02 Thread John Doe
, because it allows to do complex actions in a very short way. joe [nothing new below] > foreach my $e(@res) { > unless(ref($e)) { > print "$e is ok\n"; > } > else { > print "$e differs:actual @{[$e->[0]]} <-> register @{[$e->[1]]}\n"; > }

RE: How to compare hashes to find matching keys with conflicting values.

2006-02-02 Thread Angus
int "$e is ok\n"; } else { print "$e differs:actual @{[$e->[0]]} <-> register @{[$e->[1]]}\n"; } } -Original Message- From: John Doe [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 01, 2006 2:45 AM To: beginners@perl.org Subject: Re: H

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-01 Thread John Doe
Sorry for another mail, but there are too many typos: > Also untested: > > # If no conflict, value is hostname. > # If conflict, value is arrayref with the two different IPs > # > my @res = map { > ($actual{$_} eq $register{$_}) > ? $_ > : [$actual{$_}, $register{$_}] > > } sort keys %regist

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-01 Thread John Doe
Angus am Mittwoch, 1. Februar 2006 10.04: > Hello, > > > > I am trying to write a little script that will compare two hashes with the > same keys but conflicting values. I have found some great examples of how > to compare hashes and locate common keys or missing keys (in the cookbook). > I have a

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-01 Thread Owen Cook
On Wed, 1 Feb 2006, Angus wrote: > > I am trying to write a little script that will compare two hashes with the > same keys but conflicting values. I have found some great examples of how > to compare hashes and locate common keys or missing keys (in the cookbook). > I have also found a great e

How to compare hashes to find matching keys with conflicting values.

2006-02-01 Thread Angus
Hello, I am trying to write a little script that will compare two hashes with the same keys but conflicting values. I have found some great examples of how to compare hashes and locate common keys or missing keys (in the cookbook). I have also found a great example of how to locate duplicate k