http://qs1969.pair.com?node_id=205709


in reply to Data structure assistance

If you look at each fragment of your data, you'll probably realise how it's structured naturally. Once you've imported it, then the challenge is to restructure as required to generate the required output.

The first layer is your IP address. These fit naturally in to a hash. The second layer is domains, which will likewise be a good fit in a hash. The third is a list of times, and since you're probably not referencing them directly, these are array elements. For example:
my %data; $data{$ip_address}{$domain} = [ $time1, $time2, $time3 ]; push (@{$data{$ip_address}{$domain}}, $time4); # ... foreach my $time (@{$data{$ip_address}{$domain}}) { # ... }
So what you have is a hash of hash of arrays or HoHoA.