Close..

Change the if ( $var(%WhoIsResults,0) == 0 ) bit to:
if ( !%WhoIsResults )

smile