rfelsburg has asked for the wisdom of the Perl Monks concerning the following question:
I want to take the info in $response and populate an array based on certain keys. Is there a better way, than something like:my ($response,$array_of_responses) = whoisip_query($ip); foreach (sort keys(%{$response}) ){ print "$_: $response->{$_}\n"; }
for each piece of specific info I want to pull. Any pointers would be helpful, or just a nod in the direction of something that would be more effecient.foreach (sort keys(%{$response}) ){ if($_ =~ m/Email/g){ $email=$response->{$_}; } if($_ =~ m/Contact/g){ $contact=$response->{$_}; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Populating an array based on Net::Whois info
by affc (Scribe) on Jun 22, 2010 at 17:27 UTC |