I'm using the Device::SerialPort to listen on /dev/ttyS0 on a linux box. I have the usual 8N1 settings and I'm polling with a loop similar to this:
for(;;){ (my $count, my $result) = $PortObj->read(500); print "$result\n"; }
The serial cable is connected to another Slackware box and I'm sending strings like:
$echo "foo" >> /dev/ttyS0 $echo "bar" >> /dev/ttyS0
That works fine and I see 'foo' or 'bar' fly by on the screen when they come in. The problem occurs when the string sent contains a ^C character (\x03). It always causes the poll to halt. The script doesn't actually die, but the loop ceases and any input which is sent after that point remains undetected until the script is killed and restarted and the serial device is read once again.. at which point a few lines of what was sent after the ^C are spurted out.. and the poll continues. Does anyone have any idea on how to get around this either with some Device::SerialPort trickery, or perhaps taking control away from that terminal? thanks christo

In reply to Poll on Device::SerialPort killed by ^C by planet_guru

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.