The loop constant loop does not start until the while(<>){
so $ct is not always getting bigger, it only gets alrger each time a new keyword is added to the $spy array at the execution right? I am unsure. , ok so I should use strict, is the warnings a -w after perl on the first line? What does that do exactly? Thanks so far, keep them coming people :)
If your perl is 5.6 or later then put in 'use warnings;', if earlier (or if you need to be backward compatible), then '-w' after the 'perl' on the first line.
see perlrun for -w and perlvar for the related $^W, or 'perldoc warnings' and 'perldoc perllexwarn' for 'use warnings;'.
You are right, sorry... it is hard to do a quick review of someone else's code :) In a daemonized program, though, you really have to watch for arrays and hashes and what not that just keep getting added to, they are the most common cause of memory leaks... that's why using my in the tightest loop possible is good... then things get garbage collected when they go out of scope...