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:
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:$array{$row}{$col} = $pixel;
$hosts{$ip}{$alias} = 1;
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re^5: Perl and arrays of arrays?
by QM
in thread Perl and arrays of arrays?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |