This is a multi-part message in MIME format.

------=_NextPart_000_0021_01C6BD96.10FB8160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi=20

Why not try declaring the variables with "my" instead. A quote from =
O'Reilly's Perl in a Nutshell

Dynamic variables are visible to other subroutines called from within =
their scope. Dynamic variables are defined with local, and they are not =
private variables, but rather they are global variables with temporary =
values. When a subroutine is executed, the global value is hidden away, =
and the local value is used. Once the scope is exited, the original =
global value is used. Most of the time you will want to use my to =
localize parameters in a subroutine.

Mike
----- Original Message -----=20
From: Andre=20
To: modperl@perl.apache.org=20
Sent: August 11, 2006 9:42 PM
Subject: up2date mess continued: serious leakage!


Hello

Now the variables leak despite what I do.

Can you guys confirm if this script isn't supposed to leak? It's =
totally mad, confusing all usernames.

Thanks

Andr=E9

PS: it's a simple test.cgi wich I am calling with=20
test.cgi?username=3Djane=20
test.cgi?username=3Djack=20
test.cgi?username=3Dstacey
... and it keeps confusing all names.=20
I'm using 'local our's, so I think it shouldn't be leaking, and this =
is a problem at my mod_perl installation. So what could be causing this =
there? What do I do?


#!/usr/bin/perl -wT

use strict;
=20
use CGI;
=20
local our $q =3D new CGI;
local our $username =3D $q->param('username');

print "Content-type: text/html\n\n";
=20
defined $username and print "

Hello there, your username is =
$username
";
! defined $username and print "

[no username provided]
";
=20


-------------------------------------------------------------------------=
-----


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: =
2006-08-07

------=_NextPart_000_0021_01C6BD96.10FB8160
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




Hi

 

    Why not try declaring the =
variables with=20
"my" instead.  A quote from O'Reilly's Perl in a =
Nutshell

 

Dynamic variables are visible to other subroutines =
called from=20
within their scope.  Dynamic variables are defined with local, and =
they are=20
not private variables, but rather they are global variables with =
temporary=20
values.  When a subroutine is executed, the global value is hidden =
away,=20
and the local value is used.  Once the scope is exited, the =
original global=20
value is used.  Most of the time you will want to use my to =
localize=20
parameters in a subroutine.

 

Mike

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----

style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black">From:=20
Andre =