awm_123 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am using telnet on Solaris 10 machine. Following is the Solaris version details. Solaris 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Fire-V490. The problem is when i use the select(undef, undef, undef, 5) in my perl module, it returns 0. However when i try to telnet manually it works fine. Also the same select(undef, undef, undef, 5) works fine on my other Solaris 10 machine. Please let me if i need to do any telnet related configuration on the solaris 10 machine. I have gone through the link http://perldoc.perl.org/functions/select.html but of no help. Any help would be really appreciated. Thanks
  • Comment on Telnet Time Out while using select(undef, undef, undef, 5)

Replies are listed 'Best First'.
Re: Telnet Time Out while using select(undef, undef, undef, 5)
by Illuminatus (Curate) on Aug 22, 2008 at 12:59 UTC
    I think you are going to need to provide more details. Are you using a module for telnet? If so, which one? I don't understand what you expect to accomplish with select(undef, undef, undef, 5). I have not used it like this personally, but according to perldoc, this is really equivalent to sleep (5). Is that really what you want?
      Sorry if that post is confusing. Yes I am using a module to telnet, the one that comes with perl but modified it accordingly for bussiness needs. While doing the telnet, i am reading the file descriptors returned by "select" with 5 seconds sleep. It is expecting some Terminal Type information from the remote server but failing to receive it. I tried using 100 seconds sleep with no luck. Also i dont what kind of telnet configuration it requires on the remote server to get that Terminal Type information. The "select" is returning 0 which means it is timed out.
Re: Telnet Time Out while using select(undef, undef, undef, 5)
by ikegami (Patriarch) on Aug 27, 2008 at 06:43 UTC

    The problem is when i use the select(undef, undef, undef, 5) in my perl module, it returns 0.

    As it should, since zero file handles became signaled since you didn't provide any.

    By the way, how come you're not using sleep(5)?