> Either way I can't figure out how to raise an exception in the insert_row
> subroutine so that the parsefile() will die as well. Since I am working with
> records totalling several gigabytes, I am checking every SQL operation by
> evaling them with RaiseError turned on. This doesn't help me much, however,
> since the best I can do after a failure is return from the subroutine and
> XML::Twig will continue with its business. I could issue a finish() and the
> parser should (?) stop processing the XML, but it will still return with a
> success (I am performing safe_parsefile), and it actually doesn't seem to
> stop at all, chewing through the rest of the file. If this is true (finish()
> works as I think it works) then I guess I could use a global flag that will
> be raised if one of the inserts fails. Then after the parsefile() I will
> check it and rollback all changes to the db, but this seems really retarded.
> Are there some better ways to do this that I am overlooking?
> 

Some days I am dumber than other days. If I die() inside the handler 
subroutine, parsefile dies as well, and is caught be the global eval created 
by safe_parsefile. 
Excuse the noise :)

Peter

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to