B
bugs
i have created a script that uses the DBI and the XML:arser 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:arser, along the lines of
$dbh = DBI->connect("my connection");
$xp = new XMLarser(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
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:arser, along the lines of
$dbh = DBI->connect("my connection");
$xp = new XMLarser(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