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 ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2025-02-08 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (95 votes). Check out past polls.