if (my $result = whois($foo) ) { #here we do something if the whois failed }