Heading towards production-grade Perl-on-a-Stick

Alias on 2009-02-08T13:45:36

With the Strawberry Perl Portable Beta out for several months now, I'm starting to think about what I need to do to get this thing pushed through to a stable release.

One biggie is to resolve the bugs in the batch file generator. Some fixes have been submitted for these, so hopefully they should start working in the next release.

The other item I've been waiting on is for modules to themselves start to add Portable support, so I can identify any gaps in the implementation.

With the Config 2.0 implementation completed in Padre, making Padre itself Portable is a great test. While most of the hard word of being portable is taken care of for you by the Portable module, there's one area you need to deal with yourself.

When storing paths to disk, significant care needs to be taken to ensure that all paths are written as relative paths, and then are resolved back to absolute paths when they are read in again.

This job is complicated by the problem of knowing if and when you are running in a portable context.

Portable 0.12 has just been uploaded to the CPAN. This new release provides an easily usable $Portable::ENABLED variable. As long as your application has already loaded something with Portable hooks (like, say, Config.pm or anything that needs it) then this variable will be true if you are in a Portable context.

(And you don't even need to use Portable; or add a dependency on it yourself, just make sure to refer to $Portable::ENABLED twice to avoid warnings)


sitecustomize.pl?

dagolden on 2009-02-09T02:02:09

What about using sitecustomize.pl to set the global variable? That way, regardless of whether Portable is loaded, anything could check to see if it's running on a portable perl.

-- David

Re:sitecustomize.pl?

Alias on 2009-02-09T08:49:37

Because then it wouldn't be "site" customisation, it would be vendor customisation. :)

Re:sitecustomize.pl?

dagolden on 2009-02-09T11:05:55

Unless, for this particular case, you consider "portable" to be a "site" -- i.e a location (drive letter) that is determined by the user at run time, not the vendor at compile time.

Re:sitecustomize.pl?

Alias on 2009-02-10T00:41:13

I consider site to be a single stick, not the set of all sticks.

For the set of all sticks, the location (drive letter) is determined by the vendor at run-time.