Eureka!
   In fact I tried every method, but, as the examples didn't really
correspond to my problem, I don't know if I did it well. Anyway nothing
worked!
   I talked with one of my friend who finally explained me he had been
confronted to the same problem. At the beginning of my script I had written
"my $cgi = CGI -> new;" and the solution was to put "our $cgi = CGI ->
new;".

Anyway thank you for your help, I have learn some interesting things.

Ti Bruno

----- Original Message -----
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: "'Damien Delhomme'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, October 01, 2002 9:05 PM
Subject: RE: Has Perl extra memory!?


>
>
> > -----Original Message-----
> > From: Damien Delhomme [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 30, 2002 11:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: Has Perl extra memory!?
> >
> >
> > Hi everybody!
> >
> > One of my program generates a HTML formulary whose number of
> > checkboxes fluctuates (they are named mod_0, mod_1, mod_2,
> > mod_3...etc).
> > Therefore I need a loop in my other program which has to read
> > the formulary :
> >
> > my $count ;
> > for ($count=0; $count <= $num; $count++)
> >         {
> >         my $mod = $cgi->param("mod_".$count) ?
> > $cgi->param("mod_".$count) : ""  ;
> >
> >         if ($mod ne "")
> >                 .....................etc
> >
> > ($num is the number (-1) of checkboxes and it is stocked in a
> > hidden inputin the Web page)
> >
> > Unfortunately it seems that Perl memorises the values of
> > these "$mod_i" and doesn't always execute the script with the
> > values that are given to it!!
> > I have tried differents ways of declaring these parameters
> > (our, my, local, outside or inside the loop...etc) and there
> > has always been the same problem.
> > Basically the first formulary you fill is well executed, and
> > after that there is no way to tell when it'll start to bug!
> > Sometimes it executes the formulary you have filled three or
> > four times before!
> >
> > I hope someone could help me with this, this problem is
> > poisoning my programs!
>
> Read here:
>
>
<http://perl.apache.org/docs/1.0/guide/porting.html#Exposing_Apache__Registr
> y_secrets>
>
> Short rule of thumb I have devised to avoid this problem:
>
> Anywhere you have a file-scoped lexical in your script, like
>
>    my $foo;
>
> Change that declaration to:
>
>    our $foo;
>    local $foo;
>
> This only applies to file-scoped lexicals. "my" variables declared inside
> subs or blocks are fine. For details on why this happens and why changing
it
> to a global fixes the problem, read the mod_perl guide.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to