Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Windows Net::Telnet problem

by chas (Priest)
on Jul 05, 2005 at 12:25 UTC ( #472430=note: print w/ replies, xml ) Need Help??


in reply to Windows Net::Telnet problem

I've generally found it a bit tricky to get Net::Telnet working properly for particular machines. Something close to the following usually works for me (but seemingly inconsequential changes can cause failure):

use strict; use Net::Telnet; print "passwd: "; my $passwd=<>; chomp($passwd); #passwd not hard-coded in script my $telnet = Net::Telnet->new(Host=>'linux63.blahblah.edu',Prompt=>'/l +inux63> $ /'); $telnet->waitfor('/login/'); $telnet->print("myusername"); $telnet->waitfor('/Password/'); $telnet->print("$passwd\n"); $telnet->waitfor('/linux63/'); my @lines = $telnet->cmd("somecommand"); #etc $telnet->print("logout\n");

chas


Comment on Re: Windows Net::Telnet problem
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-31 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls