DBI and xml:parser

B

bugs

i have created a script that uses the DBI and the XML::parser modules.
i have created a connection in the main scope and then i create & execute a
statment in one of the start_handler of the xml::parser, along the lines of

$dbh = DBI->connect("my connection");
$xp = new XML:parser(HANDLERS =>{Start => \&myStartSub}

sub myStartSub {
# creates sql statment
$dbh->do("the sql statment")
}

the problem i'm having is that the sql statment is not executing, it doesn't
return any errors.
if i move the $dbh->do("the sql statment") out of the sub it works fine, but
that's not much good to me up there, it also works if i place $dbh =
DBI->connect("my connection"); inside the sub, but i don't want to be
creating a db connection evertime i parse an element.
How do i get around this?
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top