in reply to Constructing a HoA from 4 separate arrays
You can do that by working with the indexes, rather than shifting
That is non-destructive of your original data.my %ns_records = map { $ns_list[$_] => [ $addr_list[$_], $ptr_list[$_], $uptime_list[$_] ] } 0 .. $#ns_list;
A small point of style. The _list suffixes on your arrays don't add much to the readability of your code. I would drop them in favor of descriptive plurals like @addrs, @ptrs, @uptimes. Your hash would read better with a singular name, $ns_record{'foo.org'} pronounced "ns_record of foo.org".
The warning should have a line number associated with it. I think it is from line 33, @{$ns_records{$k}}->[$d], which should be $ns_records{$k}->[$d].
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Constructing a HoA from 4 separate arrays
by ikegami (Patriarch) on Oct 18, 2004 at 06:16 UTC | |
|
Re^2: Constructing a HoA from 4 separate arrays
by hsinclai (Deacon) on Oct 18, 2004 at 03:43 UTC |