Last night I officially started work on making Perl on a Stick a reality.
As we any new platform of course, things being in an extremely hacky way.
I have a 4 gig flash drive, onto which I've installed PortableApp.com and half a dozen apps, expanded the .zip package for Strawberry 5.10.0 as F:\strawberry, and copied in a minicpan mirror.
The Portable:: modules have also been hand-copied into the appropriate location in lib/site, along with the "portable.perl" bootstrap file.
The most intricate part of the conversation (although probably not the most complex) is hijacking Config.pm.
Since Config.pm was the main focus of the experimental work, it also turns out to be the simplest to enable. I've simply appended the following to the end of Config.pm.
require Portable;
Portable->import('Config');
About the only stumbling block (which actually took a while to diagnose) was making sure that the Portable::Config driver module very aggressively pre-loads the (Windows-specific?) Config_heavy.pl so that everything is loaded before we start overwriting values. With something so utterly core, the distinction between BEGIN-time and regular load time becomes important.
If the Config.pm hook were to go core, I'd also want to wrap an eval { ... } around it so that it is harmless in non-Portable contexts, but apart from that it mostly looks like we're ok on this front.
Next up is File::HomeDir, which is the other element that is in my control to change and doesn't involve collaboration.
This element is going to involve a few bigger changes, which I've been nibbling away at for a while in dev releases. Firstly, File::HomeDir is moving to a formalised driver API. This doesn't do much to enhance existing functionality, but it does allow for the ability to tell File::HomeDir to use a custom driver instead of just having to use the default implementation.
With this in place, Portable::HomeDir will be able to act as both a Portable driver and a File::HomeDir driver, and weld the two together.
As the initial target, the PortableApps.com guys have been very helpful with working out exactly what I need to do to discover the correct values to return for my_documents (and so on).
This code needs a bit more polishing, but I think by the time YAPC::NA is over I should have a viable production release for File::HomeDir which supports everything needed to make File::HomeDir portable.