in reply to perl crash during global destruction
Your test case can be simplified somewhat further and still crash:
#!/usr/bin/perl use strict; use warnings; package Foo; sub new { my ($class) = @_; return bless {}, $class; } sub DESTROY { Foo->new(); } package main; Foo->new ();
It may even be obvious now why it crashes. No? Well, consider what happens to the instance constructed in the destructor as the destructor cleans up before exiting.
It may be that this is a different issue than the one you are experiencing (I can't tell exactly from your various snippets of code), but it is the problem you describe.
Actually there are a number of issues in your code that look a little Perl 4ish or otherwise sub-optimum.
sub new { my ($class) = @_; my $self = bless {}, $class; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl crash during global destruction
by flipper (Beadle) on Apr 01, 2010 at 09:15 UTC | |
by choroba (Cardinal) on Apr 02, 2010 at 17:26 UTC | |
|
Re^2: perl crash during global destruction
by lamprecht (Friar) on Mar 31, 2010 at 21:24 UTC | |
by GrandFather (Saint) on Mar 31, 2010 at 22:08 UTC |