#!/usr/bin/perl # file: telnet_a.pl use Net::Telnet; use Term::ReadKey; #connects to the server of your choice $telnet = Net::Telnet->new('osf1.gmu.edu'); #asks for login name with password print "Login Name : "; $HOST = or die print "not a valid name"; #reads in the password without showing the character #being typed in ReadMode("noecho",STDIN); print "Password : "; $USER = <>; print "\n"; #restor to normal settings ReadMode("original",STDIN); #connects to server $telnet->login($HOST,$USER) or die print "can't access server"; $telnet->cmd('ls');