in reply to Clean Code - What a mess...

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 :)

Replies are listed 'Best First'.
Re: Re: Clean Code - What a mess...
by runrig (Abbot) on Nov 29, 2001 at 02:34 UTC
    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;'.
Re: Re: Clean Code - What a mess...
by suaveant (Parson) on Nov 29, 2001 at 19:47 UTC
    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...

                    - Ant
                    - Some of my best work - (1 2 3)