Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2017-11-25 04:20 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (355 votes). Check out past polls.