On a side note, you could use Net::Telnet::Cisco to greatly simplify your script with things like login() and a Cisco-like-prompt string so don't need any of the waitfor() commands.

#!perl use strict; use warnings; use Net::Telnet::Cisco; my $t = Net::Telnet::Cisco->new( Host => "x.x.x.x", dump_log => "file_dump", output_log => "file_out" ) or die "no connection\n"; $t->login( Name => "username_goes_here", Password => "password_goes_here" ) or die "no login\n"; $t->enable("enable_pass_goes_here") or die "no enable\n"; $t->cmd('terminal length 0'); my @showrun = $t->cmd('show run'); print $_ for ( @showrun ); print "\nmoving to next statement\n";

In reply to Re: Net::Telnet issue getting command output by VinsWorldcom
in thread Net::Telnet issue getting command output by gballanti

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.