develooper Front page | perl.perl5.porters | Postings from March 2000

panic: magic_killbackrefs

Unknown Sender
March 6, 2000 23:40
panic: magic_killbackrefs
Message ID:
(during global destruction).

I was using weak reference support (whoever implemented this deserves an
award for Most Useful New Feature -- seriously) to implement an object

My code works along the lines of ...

use WeakRef;
my %cache;
my @cache;

{ ## from 'sub new'
	my $obj = bless {x=>"y"}, "foo";
	$cache{x} = $obj;
	push(@cache,$obj); shift @cache if @cache > 10;

... though this test case doesn't exhibit the problem.

One workaround is to clear either %cache or @cache (or both) in an END
block, but IMHO that should not be necessary.

Matthias Urlichs  |  noris network GmbH   |  |  ICQ: 20193661
The quote was selected randomly. Really.    |
Never put off until tomorrow what you can do today.  There might be a
law against it by that time. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About