I personally like the hash of arrays approach, as it more closely mirrors the way I think about the problem: a key (IP address) that can have one or more aliases. However, as I noted in my original post, it is not the most efficient way to do things...just a bit easier to understand for a beginner IMHO.
I understand what you're saying, but I'd go in a different direction.
If a beginner understands AoA:
$array[$row][$col] = $pixel;
and that hashes are sort of arrays with different brackets:
$array{$row}{$col} = $pixel;
then it's a small leap to suggest that (here, at least) the keys are the interesting bits, and the values don't matter:
$hosts{$ip}{$alias} = 1;
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] [d/l] [select] |
Yeah, when you put it that way, I see what you mean. Not to mention the fact that the HoH method is far more scalable because you don't have to explicitly filter duplicates.
TMTOWDI :)
| [reply] |