Hi Fella's,

I'm new to this list, starting of with a question and hoping to be answering to
other's..

The problem I encounter is kinda strange to me. It seems as if my objects are no
longer being DESTROY'ed as soon as I have an Object (o1), that has an Object
(o2) for one of his properties which has, on his turn, again a reference to o1
as a property. This only happens when run under ModPerl, a very similar
testscript ran from the commandline DESTROY's my objects as I would expect it
to happen.

Specs on my system:
Perl 5.8.3
ModPerl 1.99_12-2.1
Apache 2.0.49
Fedora Core 2

// the way I tell apache to handle my perl scripts
     88     <Files *.phtml>
     89         SetHandler perl-script
     90         PerlHandler ModPerl::Registry
     91         Options ExecCGI
     92     </Files>

Next to my test scripts, this is pretty much all information I can think of that
could be of any use for anybody who might know the key to the solution to my
problem. This key, or even just a "you might wanna look into this or that"
would be very much appriciated.

Thanx,
Wouter

/// Following now are my test scripts
// - test.phtml
      1 #!/usr/bin/perl -w
      2
      3 use lib qw(./lib);
      4 use strict;
      5 use Data::Dumper;
      6 use TestTop;
      7
      8 my $Test = new TestTop();
      9
     10 print Dumper($Test);

// - Test.pm
      1 package Test;
      2 use strict;
      3 sub new {
      4     my ($pkg, $rec) = @_;
      5
      6     $pkg = bless {Link => $rec}, $pkg;
      7     return $pkg;
      8 }
      9 sub DESTROY {
     10     print STDERR ref(shift)."::DESTROY()\n";
     11 }
     12 1;

// - TestTop.pm
      1 package TestTop;
      2
      3 use strict;
      4 use Test;
      5
      6 sub new {
      7     my ($pkg) = @_;
      8     $pkg = bless {}, $pkg;
      9     $pkg->{Test} = new Test($pkg);
     10
     11     return $pkg;
     12 }
     13 sub DESTROY {
     14     print STDERR ref(shift)."::DESTROY()\n";
     15 }
     16
     17 1;

(of course I first encountered this problem in some more advanced perl code, but
I don't think anybody would like to wrestle through hundreds of lines of code
just to help me out)



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to