my $input; sysread ($sock, $input, 1024); # that will not block gtk2 print $input;