> [20011]ERR: 24: Line 13: Error in Perl code: (in cleanup) [Mon
> Feb 7 12:08:23
> 2000] PerlHandler subroutine `HTML::Embperl': Cannot access
> 'DESTROY' field in object of class PRCL::Player at
> /usr/lib/perl5/site_perl/5.005/i586-linux/HTML/Embperl.pm line 557
>
> The page looks like:
>
> <HTML>
> <HEAD><TITLE>Test</TITLE></HEAD>
> <BODY BGCOLOR=WHITE>
> [-
>    use PRCL::Stats;
>    use Data::Dumper;
>
>    my $stats = new PRCL::Stats("dbi:mysql:prcl", "root");
>    my $batter = $stats->get_batter($fdat{'id'}, '', '1997-09-28');
>
# The scope of my $batter ends here!!!!!
> -]
> <PRE>
> [+ Dumper $batter +]

$batter is undefined here! remove the my above (if this not only a typo in
your mail)

>
> I guess what confuses me is why does Embperl need access to a
> DESTROY field(?)
> in PRCL::Player?
>

Embperl cleans up all your globals after the request, so if you have an
reference to an object that is store in an global Embperl will do something
like

undef $batter

after the request and this will (if no other reference still exists) destroy
the object and therfore try to call the DESTROY method of your object, but I
don't know why Perl is talking of a DESTROY field.

> I'm using HTML::Embperl 1.2b5.
>
Maybe it time to upgrade? Many things has changed since 1.2b5

Gerald

Reply via email to