Use perl-critic this will find most of the nasties that you have the classic is:

my $var = {code} if {condition};

The my gets round perl strict, but $var doesn’t get updated if {condition} 
isn’t met, so holds the variable from the last time round..

Better is

my $var = ‘’;
$var = {code} if {condition};

or

my $var = {condition} ? {code} : ‘’;

From: Steven Haigh <net...@crc.id.au>
Sent: 08 February 2021 09:09
To: modperl@perl.apache.org
Subject: Re: Moving ExecCGI to mod_perl - performance and custom'modules'[EXT]

On Sun, Feb 7, 2021 at 15:17, Chris 
<cpb_mod_p...@bennettconstruction.us<mailto:cpb_mod_p...@bennettconstruction.us>>
 wrote:

Just remember to always write clean code that resets variables after doing 
tasks.

I'm a bit curious about this - whilst I'm still testing all this on a staging 
environment, how can I tell if things can leak between runs?

Is coding to normal 'use strict; use warnings;' standards good enough?

Are there other ways to confirm correct operations?

--
Steven Haigh 📧 net...@crc.id.au<mailto:net...@crc.id.au> 💻 
https://www.crc.id.au 
[crc.id.au]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.crc.id.au_&d=DwMFaQ&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=oH2yp0ge1ecj4oDX0XM7vQ&m=4WgSuD9BTWr09e71eanf57nyBNHOPXE7hNOgLlKJcA4&s=UVVXHyoyL1iyknEcMp0sf6Nm1yO69SF8h4h4XDhcGeo&e=>



-- 
 The Wellcome Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE.

Reply via email to