develooper Front page | perl.perl5.porters | Postings from November 2009

Re: [perl #67838] lvalue substr keeping lexical alive

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
November 27, 2009 06:38
Subject:
Re: [perl #67838] lvalue substr keeping lexical alive
Message ID:
7x4oog8244.fsf@blackbox.eirik.dav
"H.Merijn Brand" <h.m.brand@xs4all.nl> writes:

> On Fri, 27 Nov 2009 11:41:19 +1100, Kevin Ryde <user42@zip.com.au>
> wrote:
>
>> "Eric Brine via RT" <perlbug-followup@perl.org> writes:
>> >
>> > lexicals aren't freed when they go out of scope. They stay
>> > allocated (along with their string buffer) for reuse the next time that
>> > scope is entered.
>> 
>> Ah, I didn't know that.  Makes it hard to work carefully with big
>> strings.  You'd be tempted to free big things, above some threshold, on
>> the relative badness of time taken to malloc a new block.
>
> $s = undef;

  Did you mean undef($s), or did something change while I was not
looking? ;-)


Eirik, who doesn't use that feature often either
-- 
The price of success in philosophy is triviality.
                -- C. Glymour.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About