in reply to Recursive dbh executions

update: please don't delete your question. You're making it impossible for anybody to figure out what this thread is about.

old reply follows...

Your problem isn't with the $sth; since $sth is a lexical variable, each recursive call to GetChildren will have it's own version of it.

I'm not sure if you can nest SQL queries on a single database handle, though.