use Net::Telnet(); $telnet = new Net::Telnet ( Errmode=>'die', Prompt => '/\$ $/i'); $telnet->open(host=> 'xx.xxx.xx.xxx', Port => 80); $telnet->login('username', 'password'); print $telnet->cmd('who');