OK, fine.
So, to sum up, if I have got 10 different scripts in a mod perl environment
(let's call them test1.pl....test10.pl), and using lexical variables there.
If I first run test1.pl and then, run test2.pl, the only way for test2.p to
get access to the memory used by test2.pl is freeing up test1.pl lexical
variables, by undefining them?
And what if I run test1.pl twice without undefining its lexical variables?
Will the same memory space be used twice, or will each call use different
memory space (I'm talking here about situation where the same Perl
interpreter is running the script twice in a mod perl environment)?
Lionel.
----- Original Message -----
From: "Perrin Harkins" <[EMAIL PROTECTED]>
To: "Lionel MARTIN" <[EMAIL PROTECTED]>
Cc: <modperl@perl.apache.org>
Sent: Friday, May 11, 2007 12:17 AM
Subject: Re: After retrieving data from DB, the memory doesn't seem to be
freed up
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote:
> There's really no difference in the way globals behave under mod_perl.
> You just don't notice it under CGI because the process quits right
> after the request has been served.
[...]
So, this clearly shows that the global variables sticks in memory, while
the
lexical one doesn't.
So, I would imagine that after the script is run, space used by the
lexical
variable would be freed up.
That's what I'm telling you -- it won't be. The value will be gone,
but the memory allocated to it will still be allocated to it. It
won't be reused for other variables unless you undef $lexical.
The other thing I was trying to explain is that the behavior of
globals and lexicals is not affected by mod_perl. They behave the
same way in any perl program.
- Perrin