in reply to SQLite database (or any) file in main memory!
There are many *NIX system-level routines for doing so. In BSD, 'device MD' is the system-level ramdisk. Also to be considered are shared memory (SYSVSHM). There is a slight overhead penalty for accessing chunks of this, but it's less than a filesystem access. As has already been stated, SQLite is capable of being wholly memory-resident. I'm not sure that it will stay resident, though, as the swapper comes for all of us.
The only way I know of to make sure your data will stay in memory is to compile it into the kernel, since the kernel is the only process that will never be swapped. If you carry the recompilation far enough, e.g., adding global symbols to the C compiler and Perl interpreter, you can access this as though it is just another Perl data structure. For most cases, it's rather dumb to go this far, but I have seen it done (not in Perl, in Apache w/modules) on a dedicated system, and it can provide dramatic speedups.