The link that Caryatis is referring to is
http://www.eqemulator.org/forums/showthread.php?t=35216, which through the title, unless you knew what DBI was, you'd not know to look for it.
Also, in your plugins folder is GetSpawn2IDs.pl which is what Tabasco is referring to if you want to look at an example on how to use it.
But, Qglobals seems to be the way to go, they work for what they are needed for, I wouldn't mess with DBI unless it was absolutely necessary.
Good luck.