You sound like you want to store many many relationships in a large data structure. For anything of this size, that sort of setup doesn't scale well, and queries will get slower and slower as you have to scan across more and more groups of data to find the piece you are looking for.
This sort of storage is the forte of a database. I advocate
mySQL as it is fast, well documented, and will save you a lot of time versus a flat file. This isn't a weakness of perl, it's a strength of indexed, and easily searchable, databases.
Good luck with your project.
--
jb