planet_guru has asked for the wisdom of the Perl Monks concerning the following question:

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