in reply to Telnet to server

You can also tell Net::Telnet what prompt to look for. A description is in the POD of Net::Telnet.
use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/bash\$ $/'); $t->open("sparky"); $t->login($username, $passwd); @lines = $t->cmd("who"); print @lines;