I've been tasked to create a quick little Perl script to monitor the output from a Cisco router's serial port and to print it out to STDOUT. I want to have the output be flushed to STDOUT at every newline. I discovered today Cisco (at least for IOS v12.4) uses CRLF (\x0A \x0D) for their newlines. I thought I could just have my code say:

$objPort = new Win32::SerialPort...; $objPort->are_match("\n", "\r\n"); $foo = $objPort->lookfor;

I ran the script during the router's bootup; it only picked up 4 lines or so while skipping the rest of the others. I've searched online but most of the stuff was about stripping newlines from serial streams. Has anyone else tried this before? Thx for your attention.

Edit: g0n - code tags


In reply to Need help with Win32::SerialPort by GoTerpsGo

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.