Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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.....

Thanks.....

Comment on Net Telnet problem for windows
Download Code
Re: Net Telnet problem for windows
by Limbic~Region (Chancellor) on Aug 19, 2005 at 15:00 UTC
    chennaiite,
    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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://485162]
Approved by Roger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2015-02-28 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    On my keyboard, Caps lock is:








    Results (465 votes), past polls