On Tue, 15 Aug 2000, Vladislav Safronov wrote:

> "my" (perl's my) variables doesn't always get destoyed, does it???? Perl's 
> documentation say that "my" vars are the most safe since they get destroyed
> when they get out of scope ...

I said this was a bug in Perl, although I don't think that 5.6.1 is fixing
it (due out "soon"), because its quite hard to track down. It occurs in
conditionals:

if (my $rec = foo()) {
        # lexicals in foo() not destroyed here
}
# lexicals in foo() destroyed here.

This can be demonstrated with a very simple object class with a DESTROY
method. There's a message somewhere in the p5p archives about this from
me.

(and I don't mean the lexicals that might get returned and assigned to
$rec, for anyone assuming I don't know what I'm talking about)...

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org

Reply via email to