I can try that. I know that if I just open a file and do a "while (<FILE>)" loop to read it, it blocks when there's no input. That's fine as long as that file is the only source of events, but I want to have others as well.
Thanks- Colin On Fri, 2002-02-08 at 21:45, Joshua N Pritikin wrote: > On Fri, Feb 08, 2002 at 03:37:17PM -0500, Colin Murtaugh wrote: > > I'm trying to use Event.pm to do some pretty basic event handling > > (watching for incoming data on a named pipe, and eventually some timers) > > but I keep having trouble with CPU usage. Seems that once the loop > > starts, my script uses all available cpu. The script I'm using to test > > with is below. What am I doing wrong? > > My guess is that files are always readable whether there is new data or not. > Instead you should poll for new data every fraction of a second, similar > to "tail -f". > > -- > Victory to the Divine Mother!! after all, > http://sahajayoga.org http://why-compete.org
