Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Net Telnet problem for windows

by chennaiite (Sexton)
on Aug 19, 2005 at 14:41 UTC ( #485162=perlquestion: print w/replies, xml ) Need Help??
chennaiite has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, Just Its a simple question... Can anyone tell me how to set the Prompt value in NET::TelNet
use Net::Telnet. my $telnet = Net::Telnet->new(Host=>'hostname',Prompt=>'/[%#>] $/'); $telnet->open('host'); $telnet->login('user', 'Passwd'); print $telnet->cmd('who');
I want to connect to the remote ip address(host)... Always i am getting "Timed out waiting for login prompt at line no 4.....

How to correct to prompt regexp for windows.....

I will be pleased if you give any suggestions regarding this.....


Replies are listed 'Best First'.
Re: Net Telnet problem for windows
by Limbic~Region (Chancellor) on Aug 19, 2005 at 15:00 UTC
    I assume you have RTFM'd regarding Net::Telnet and windows machines. The author didn't think too highly of Window's telnet. OTOH, the module has been touched since 2002 so perhaps it is much less of a problem since it was written. Using Super Search and looking for Net::Telnet and windows, it seems as though people are having a wide range of problems. Here are a couple of the prompts I saw used with apparent success:
    Prompt => '/>/', Prompt => '/C:\\\\>.*$/');
    Hope this helps!

    Cheers - L~R

Re: Net Telnet problem for windows
by Roger (Parson) on Aug 19, 2005 at 15:04 UTC
    Why don't you manually open a telnet session inside a DOS box, and see what the actual login prompt looks like?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://485162]
Approved by Roger
[Corion]: Oh yay. Why do I test a migration with transaction code "T" when the real trades from the migration will come with P9N (which is excluded from the processing)?

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2017-09-26 15:07 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (296 votes). Check out past polls.