You may have to implement the sharing method yourself. In
other words, if you want to share a variable between two
different processes, you may have to implement some method
of serializing that variable; then you can store the serialized
version in a file or in a database and both processes can
have access to it. Managing changes to the variable across
the separate processes will be a challenge.
For serializing the data, look into Storable or Data::Dumper.
Perhaps you could use shared memory for this; you might want
to check out IPC::SharedCache,
which lets you store data in shared memory. It automatically
serializes the data for you. Actually, I'd say this is a
good place to start looking.