It looks like you really could do with some module like
DBIx::Class which is all about linking objects to database-tables, records, relationships, ... etc. Have a look at it, it seems overwhelming at first, but once you are into it, you never will go back to "pure" DBI. There is a very lively and responsive community of designers and users working on it (all info in the docs!).
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law