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=>'/linux63> $ /'); $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");