Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Net Telnet problem for windows

by chennaiite (Sexton)
on Aug 19, 2005 at 14:41 UTC ( [id://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.....

Replies are listed 'Best First'.
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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found