Q:

Is there a way to keep perl test data in memory between test runs?

When I run my test cases via prove, it takes about 20 - 25 seconds to load my test data before the first test runs. Is there a way I could have a separate, persistent process load the test data in memory, and prove just retrieve a copy instantly each time I run my tests?
I know I could have a separate process return JSON/XML, but then it would have to be parsed. I'm wondering if I could have another process that returns a reference to a data structure.

A:

If you're talking about separate program invocations - no, there's no way to do that. Memory is owned within the process, and it's destructed after the process. 
The only way to do what you're trying to is:

Have a parent process 'load' the data.
fork the child process

This means the 'loaded' data will be retained in memory - fork uses copy-on-write for each of the children (So if it doesn't change, you won't use more memory at all). 
But each child will have access to the same 'memory space'. 
Alternatively, you could use Storable - and either:

write your data structure to disk (or /tmp) using store and retrieve.
pass data as a scalar using freeze and thaw.

