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

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=>'',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");


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://472430]
[Eily]: and this time you didn't get "but the OP only asked for a solution with sed, grep, awk, bash, tail and cat"
[choroba]: When I get that, I usually just reply "Good luck" and move on.
[marto]: I'm sure it's only going to be a matter of hours before someone adds that comment
[marto]: or closes the question because it's a almost the same as one someone else asked, years ago...
[marto]: snackoverflow gamification of editorial powers for the win :/
marto should register snarkoverflow
[marto]: nothing to see here people, go about your daily business :P

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2018-01-23 10:37 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (243 votes). Check out past polls.