Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hello All,

I'll try to ask this as clearly as I can. Can't seem to find an answer to how to fix this. Currently I am using the telnet module to login to a machine and retrieve information using a simple info command(it retrieves machine type, serial number, MAC addresses, etc.) The problem I am having is the output contains -> as one of the MAC address entries.

When I get to that entry, perl stops trying to gather more data and my script stops. Here's the snippet of code. As you can see, it's very simple.

$telnet->print("info -T system:$target"); @infosyst=$telnet->waitfor('/>/i');

Now I can also just print the result with print $telnet->waitfor('/>/i'); Either way, the output is the same

Where I should receive this as the output

MAC Address 1: 00:1A:64:85:B2:C0 -> 00:1A:64:85:B2:CF
MAC Address 2: Not Available
MAC Address 3: Not Available
MAC Address 4: Not Available
MAC Address 5: Not Available
MAC Address 6: Not Available
MAC Address 7: Not Available
MAC Address 8: Not Available

I receieve this and the script stops
MAC Address 1: 00:1A:64:85:B2:C0 ->

How do I tell it to ignore that as a command? telnetmode does not work for this case.

All help appreciated,

In reply to Perlnet Telnet issue with -> by Flynt

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (3)
    As of 2020-10-23 03:02 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (234 votes). Check out past polls.