rfelsburg has asked for the wisdom of the Perl Monks concerning the following question:

I'm using net::whois::ip The standard way of pulling info out of whois is below.
my ($response,$array_of_responses) = whoisip_query($ip); foreach (sort keys(%{$response}) ){ print "$_: $response->{$_}\n"; }
I want to take the info in $response and populate an array based on certain keys. Is there a better way, than something like:
foreach (sort keys(%{$response}) ){ if($_ =~ m/Email/g){ $email=$response->{$_}; } if($_ =~ m/Contact/g){ $contact=$response->{$_}; } }
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.

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
    I suppose you could use grep to filter out specific keys.