On Nov 9, 2009, at 10:06 AM, Eric Shubert wrote:

Any perl programmers out there care to have a look at it?


sure.  the problem is in lines 290-307; it's a variable scope issue.

the variables $perc1, $perc2, and $perc3 are used in the printf() on line 308; however, each of them is declared inside if..else blocks, which means that they are undefined outside of the scope of those if..else blocks.

i would point out that running Perl with warnings enabled, which is a pretty much universal best practice, exposes the problem :)

the bug is fixed in sa-stats-1.03 (http://www.rulesemporium.com/programs/sa-stats-1.0.txt ); attached is a patch that modifies sa-stats-1.03 to work with QMailToaster. if for some reason you don't want to update to sa- stats-1.03, i have also attached a patch that implements a fix for the problem within 1.02.

-steve

--
If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v
http://five.sentenc.es

Attachment: sa-stats-1.03_qtp.patch
Description: Binary data

Attachment: sa-stats-1.02_variable-scope.patch
Description: Binary data

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to