in reply to Re^2: Perl and arrays of arrays?
in thread Perl and arrays of arrays?
Your comment is wrong, but your code works:
That's the same as:# USAGE: $masterhash{$ipaddress} = @aliases
What you want in this case is:$masterhash{$ipaddress} = scalar @aliases
The only justification for array of hashes I can come up with is if the number of entries is very large, and you manage duplicate hosts. (For example, the file is already sorted by host, and you keep track of the last host. If the current host is the same, the new data is added to the last host entry. Otherwise, a new host entry is created first.) But searching the host array to find the correct entry on a large array is problematic.$masterhash{$ipaddress} = \@aliases
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl and arrays of arrays?
by Koolstylez (Scribe) on Aug 17, 2005 at 19:51 UTC | |
by QM (Parson) on Aug 17, 2005 at 20:44 UTC | |
by Koolstylez (Scribe) on Aug 17, 2005 at 21:10 UTC |