Um. Well. There's quite a few stumbling blocks here:
- I'd change the DBI connect to throw an error if it fails rather than use a conditional after.
- explain what %list is, since you don't include the declaration code here.
- same for getRecord()
- remove fluff code - the "if (scalar(@dbrec) > 6 )" has nothing to do with whether the key is deleted. heh, maybe that's the bug though and the delete line should be on the other side of the closing brace?
- in this context, the "if (@dbrec)" conditional is pointless too
Maybe then we'll have a chance at helping you...