use strict; use warnings; use IO::Handle; open my $WHOIS, "jwhois x.x.x.x 2>&1 |"; my $io = IO::Handle->new; $io->fdopen($WHOIS, "r"); $io->blocking(0); print $io->getline; $io->close;