in reply to Re^4: Perl and arrays of arrays?
in thread Perl and arrays of arrays?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Perl and arrays of arrays?
by Koolstylez (Scribe) on Aug 17, 2005 at 21:10 UTC |