$fh = IO::Socket::INET->new(%arg); IO::Socket::SSL->start_SSL($fh , %opts); # this is the snippet to fetch new data $bits = ''; vec($bits, fileno($fh), 1) = 1; if(select($bits, undef, undef, $timeout)) { $len = sysread($fh, $buf, 200, length($buf)); } else { die "timeout: $!\n"; }