in reply to How to force a timeout on a system call?

I'd actually eliminate the problem sideways and use Net::XWhois:

use Net::XWhois; my $whois = new Net::XWhois DOMAIN => $domain;

Then do whatever you're after on the response. To get the name servers:

   @nservers = $whois->nameservers()

--tarjema