in reply to MySQL and perl? Or something else?

A database of sorts does seem to be the way to go, but the concept of "database" doesn't automatically imply something as robust as MySQL (which belongs to a class of databases called RDBMS -- Relational DataBase Management Systems).

It looks like what you're interested in is a category of problem called "data serialization" -- storing data structures (usually to disk) for later retrieval. There are plenty of modules to do this, including Storable and DBM::Deep.

Considering that you're trying to learn more about data structures, though, I might suggest you look at one of the human-readable serialization formats, like YAML.

You can serialize data to database systems (even RDBMS) as well, but I'd tackle that separately from learning about managing data structures -- no sense piling your plate too high (do the simplest thing that could possibly work!). When you're ready, you'll want to grab a book or two on Relational theory so that you can design good uses for RDBMS. Then, you'll want to check out the DBI module.

<radiant.matrix>
Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet