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
In reply to Re: Constructing a HoA from 4 separate arrays
by Zaxo
in thread Constructing a HoA from 4 separate arrays
by hsinclai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |