sub cmd_telnetlong { my ($obj, $cmd) = @_; my ($line, $pos); my $max_tty_line = 254; ## Break-up the one large command line and send as shorter lines. $pos = 0; while (1) { $line = substr $cmd, $pos, $max_tty_line; $pos += length $line; last unless $pos < length $cmd; ## Send the line with continuation char. $obj->cmd(-string => "$line^", -prompt => '/More?/i') or return; } ## Send the last line and return the output. return $obj->cmd("$line ; exit"); } # end sub cmd_unixlong