http://www.perlmonks.org?node_id=424836


in reply to problem in perl telnet module

It would really help if we knew exactly when it's hanging--is it during open? login? cmd?

Have you tried using input_log, as the documentation recommends? If it's hanging during cmd, that could indicate that the Prompt regex is incorrect; input_log may help you debug that.

In the mean time, I'd like to point out a couple other problems:

=cut
--Brent Dax
There is no sig.

Replies are listed 'Best First'.
Re^2: problem in perl telnet module
by Fletch (Bishop) on Jan 25, 2005 at 12:20 UTC
    $ perl -MO=Deparse,-p,-q -e '$telnet = new Net::Telnet->new( Timeout=> +20,Prompt => "/[\$%#>] $/");' ($telnet = 'Net::Telnet'->new->new('Timeout', 20, 'Prompt', ('/[$%#>] +' . $/)));

    Net::Telnet's new has the called-with-ref-use-its-class incantation (way back in IO::Handle::new). But you're right, it's unnecessary.