in reply to Databases with in databases

Is it possible to do something like this, storing a database within another one?

Yes, with some definitional quibbles. If the user-supplied Perl code can get by with storing and retrieving data structures, then it might be possible to pickle data structures into BLOBs (perhaps using Storable or Data::Dumper), and then store the BLOBS in a table you're reserved for this purpose. You do, of course, lose the ability to query within the the BLOB.

Is this what you meant by your option (C)?