Monitoring Serial Port in Perl without using 100% CPU

Hi,

I've implemented a Perl script using this page as a template: http://playground.arduino.cc/interfacing/PERL

The while(1) loop uses 100% of the CPU power available. Is there a way to do this without using so much processor load? In my case the Arduino spits out a line of telemetry once per second. The perl script reads this and inserts it into a db. Any suggestions about better ways to do this? Thanks,

David

put in a sleep of a few (10) milliseconds as the hardware will buffer several characters anyway ?

include "all disclaimers"

#include "all disclaimers"

What operating system allows spaces in file names?

PaulS: What operating system allows spaces in file names?

Windows seems to.

Try using "select" to wait for data with a timeout. I think it's in IO::select.pm or something like that.

Thanks, sleeping fixed it up. Seemed silly that such simple code would chew so much. Thanks,

David

Code:

include "all disclaimers"

What operating system allows spaces in file names?

almost all? and yes spaces are mainly for us mere mortals to help our associative brain ;) and yes they cause a lot of trouble (almost daily! )