#!/usr/bin/perl use strict; use warnings; use Net::Telnet(); my $host='xxx.xxx.xxx.xxx'; $t = new Net::Telnet (Timeout => 10, "Prompt" => '/[$%#>] \z/n'); $t->open($host); $t->cmd("command"); while (my $t = $t->getline()) { print "$line" } $t->close(); exit 1;