DBD::AnyData supports this. I haven't used it, but it appears to be as simple as passing it a reference to an array of rows (look at the section on "in-memory tables"). I've seen a number of Monks recommend this module and there is a PM
review of it online as well.