Hi
 
    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 -----
From: Andre
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é
 
PS: it's a simple test.cgi wich I am calling with
test.cgi?username=jane
test.cgi?username=jack
test.cgi?username=stacey
... and it keeps confusing all names.
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;
 
   use CGI;
  
   local our $q = new CGI;
   local our $username = $q->param('username');
   print "Content-type: text/html\n\n";
  
   defined $username and print "<p>Hello there, your username is $username <br>";
   ! defined $username and print "<p>[no username provided]<br>";
     


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

Reply via email to