On Sun, Jul 08, 2001 at 02:20:40PM -0400, Jim Conner wrote:
> I am writing a script that is quite cool imo once I get it done.  But 
> already I am seeing that it takes a ton of system resources.  Simply put, 
> the script watches a log file (like tail -f) and then reacts to certain 
> things that occur.  I am thinking that the loop that it is in might be 
> taking up all the resources but that doesn't quite jive with my knowledge 
> of how this kind of thing works.  Here is a snippet of the resource usage 
> from top(3):

You're using up all those resources because your program is sitting in
a hard loop.  Try inserting a sleep at the bottom of your outer for
loop.  You might also want to take a look at "How do I do a 'tail -f"
in perl?' in perlfaq5.

Walt

Reply via email to