[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-modperl
Subject: RE: Embperl and recursion using Execute()
From: "Gerald Richter" <richter () ecos ! de>
Date: 1999-07-31 18:20:22
[Download RAW message or body]
>
> Hey,
>
> i'm trying to display a tree structure with Embperl. the only
> reasonable way to do it in my sight is to do recursion with
> Execute.
>
> has anyone tried to do that?
Yes, I do that with success :-)
> there seems to be some sort of
> a problem with variable scopes, the error message i get is:
>
> ERR: 32: Line 3: Warning in Perl code: Database handle
> destroyed without explicit disconnect at td-puu2.html line 3.
>
> source files are included.
>
The problem is that $dbh and $sth are globals, so the $dbh = DBI->
connect(...), will destroy the database handle of your outer recursion
level.
The first thing to do is to move the connect/disconnect out of the recursion
(put it in td-puu2.html), because the call to connect is only necessary
once.
The second thing is the localize your statement handle. Put a
[* local $sth *]
at the top of td-puu2.html. (NOTE the [* *] syntax!) (maybe it's necessary
to localize more variables, I didn't looked so close).
Gerald
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic