Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

  (email not shown publicly)

Journal of Alias (5735)

Wednesday June 11, 2008
12:43 AM

"Perl on a Stick" begins

[ #36650 ]

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 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

Since 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

require Portable;

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?) 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 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 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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Glad to see this coming to fruition. Let me know when this gets to the testing phase and I'll update the PortableApps Portable Perl beta and get it out there for testing.