develooper Front page | perl.perl5.porters | Postings from October 2005

Re: Sort / multicall patch: second draft

Thread Previous
From:
Robin Houston
Date:
October 28, 2005 10:01
Subject:
Re: Sort / multicall patch: second draft
Message ID:
20051028170108.GA9366@rpc142.cs.man.ac.uk
On Wed, Oct 26, 2005 at 06:39:01PM +0100, Robin Houston wrote:
> [...] But this isn't ordinarily a problem: e.g.
> 
>   $ ./perl -e '@a=(1..10); @b = (@a,(@a=())); print @b'
> 
> doesn't cause this error.

Never mind! You *do* still get the same problem with:

   $ ./perl -e '@a=(1..10); my @b = (@a,(@a=()))'

The code I had before only "works" because the new scalar
that is allocated from the pool for the copy happens to
be the same as the old freed one that's being copied!

So this problem is not at all specific to sort(), though
it is certainly real.

Robin

Thread Previous


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