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:
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:
So what you have is a hash of hash of arrays or HoHoA.my %data; $data{$ip_address}{$domain} = [ $time1, $time2, $time3 ]; push (@{$data{$ip_address}{$domain}}, $time4); # ... foreach my $time (@{$data{$ip_address}{$domain}}) { # ... }
|
---|
In Section
Seekers of Perl Wisdom