Stories
Slash Boxes
Comments
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)

Alias
  (email not shown publicly)
http://ali.as/

Journal of Alias (5735)

Sunday February 08, 2009
08:45 AM

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

[ #38429 ]

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)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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

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

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

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