Depending on your goals, you might like the look of Storable combined with DB_File or even better DBM::Deep. DBM::Deep is wow. Since you specifically mention YAML and "text", I suspect this isn't quite the same direction you're tyring to go, but it's worth mentioning just in case.
My meaning is that when the data gets really big, a human readable layout may not be the best choice. The alternative is to break up the data and use the file-system as your "database." But I don't know anything about the problem you're trying to solve.