in reply to IO::Socket::SSL's select() ignores pending data

In your select(), you're waiting for socket to become readable, but SSL communication is not as simple as that, it may require some internal writing in between. Your generic code should be more like this:

if ( $SSL_ERROR == SSL_WANT_READ) { select($rbits,undef,undef,...); sysread... } elsif ( $SSL_ERROR == SSL_WANT_WRITE) { select(undef,$wbits,undef,...); sysread... # YES, sysread! }
I recently played with non-blocking SSL stuff, and both timeout and select work fine for me that way.

OTOH all that stuff is needed only for non-blocking code. If the only thing needed is timeout in blocking code, I'd just use alarm($timeout).