![]() |
|
There's more than one way to do things | |
PerlMonks |
Re: Data structure assistanceby BrowserUk (Patriarch) |
on Oct 16, 2002 at 15:23 UTC ( #205742=note: print w/replies, xml ) | Need Help?? |
On the basis of what you've told us (which as George_Sherston said, isn't enough to make a good judgement), I think tadman's method is good except that it means that you need both the ip and the domain name to access the timings. As many ISP's use a single ip to serve several domain names, retaining both peices of information is necessary, but it would be more convenient to only use the domain name for access to the data structure. If, in the context of your application, you need/want to use the datastructure to lookup the ip associated with a given domain name then a structure like this might be better.
That way you can use these lines to lookup the ip from domain or vice versa my $domain = $data{$ip}{'domain'}; my $ip = $data{$domain}{'ip'}; and this to access the times individually. print @{$data{$domain}{'seconds'}}[3]; # 4th timing. Or something like this to access them in sequence.
Note: Some of the punctation in this post is redundant, but I was trying for clarity Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!
In Section
Seekers of Perl Wisdom
|
|