use Net::Telnet (); $telnet = new Net::Telnet(Timeout=>20,Prompt => '/[\$%#>] $/'); $telnet->open("machine"); $telnet->login("username","password"); print "Logged into the system \n";