ajefferies has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks,
I am trying to create a script to track and store domain information. I'm hoping to store the information in a hash by domain level. Kind of like:
.com->domain1->subdomain ->domain2->subdomain ->subdomain2 .net->domain1->subdomain ->subsubdomain1->subsubsubdomain1 ->subsubsubdomain2
I have the URI elements broken out into an array (rootdomain,domain,subdomain,...) and I want to insert them into a hash.
How can I check each element to tell whether it should create a new domain or go into an appropriate existing one and keep checking if it already exists.
Is there some funky statement I can use to check each level of domain to see if it's level exists. The answer is obvious to me if it is a fixed number of sub-domains but I can't figure out how to do it with different numbers of domains. (ie. www.perlmonks.com or seek.wisdom.here.perlmonks.com)
Thoughts?
Thanks in advance for your assistance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: storing domain info in hashes of hashes
by Aristotle (Chancellor) on Nov 18, 2002 at 16:39 UTC | |
by ajefferies (Initiate) on Nov 20, 2002 at 14:38 UTC | |
|
Re: storing domain info in hashes of hashes
by pg (Canon) on Nov 18, 2002 at 16:35 UTC |