http://qs321.pair.com?node_id=670212

Ave sodales ab camelus

I like UltraEdit321 it's nice. I like it for hacking about with Perl, ECMAScript2, XML, CSS, and XHTML... and I suppose plain text too. At the same time as purchasing it, I wanted to be able to continue my hackery at work (where I don't have install privilages) so I thought about running it off a flash drive... then I saw this. I pondered this briefly and purchased the UltraEdit/UE3 bundle, and a 4GB U3 flash drive (and a 2BG U3 Flash drive to bribe Her, which she likes very much). This works very very well.

Shortly afterwards I found Command Prompt Portable U3 and it occured to me "If I can fire up a command prompt off my flash drive, can I make Perl run off it too? Then I'd have a Perl dev-suite in my pocket. That would be cool."

The plan was simple;

  1. Install Command Prompt Portable U3 onto my stick, and run it once to finalise the installation.
  2. Do a fresh Strawberry Perl3 install (download from here)
  3. Copy the installation to the flash drive
  4. Edit the environment variables set in commandprompt.bat to include the new Perl directory, before any existing paths. Something like this:
    echo Setting Path to Strawberry Perl set STRAWBERRY=%U3_DEVICE_PATH%\strawberry path %STRAWBERRY%\c\bin;%STRAWBERRY%\perl\bin;%PATH% set LIB=%STRAWBERRY%\c\lib;%STRAWBERRY%\perl\bin;%LIB% set INCLUDE=%STRAWBERRY%\c\include;%STRAWBERRY%\perl\lib\CORE;%INCLUDE +% set PKG_CONFIG_PATH=%STRAWBERRY%\lib\pkgconfig
  5. Bingo! Portable command prompt with Perl

Actually it was as simple as that. Perl mostly worked.

What didn't work was installing things with CPAN... especially things that needed C++ complied. The first bit was fixed with a Perl program that was run on opening the command prompt (see this meditation on Changing Perl Config settings). This also partially solved the compiling problem (to some degree, still can't compile GTK2-perl4), but I'll probably meditate on that in another thread.

Following the instructions randyk has given here adds PPM, XML::Parser, eXpat and SOAP to the Strawberry Perl installation, giving my stick working PPM installs, and this line ppm set build %STRAWBERRY%\ppm is added to commandprompt.bat5 to set up a working directory for PPM (you may have to create it manually first).

So far it's been working very well (except for C++ compiling) and I prefer it now to my own computer's installation of Perl (ActiveState 64bit actually). I have noted the following issues:

This tells me I need to make a roll-back script that restores those config.pm.orig files I carefully backed up and removes the cpan lock file, and I need to carefully put together my compile libraries.

Do any other Perl Monks have any further suggestions or comments for this project?

Updated:Incorporated material from comments.

1Damn. I just noticed that the new version is out. With added nifty, like useing regexes to do search and replace within your documents. Sigh, so many features to ignore...

2I despise the JavaScript misnomer. Stop it. You too can help stamp out confusion.

3I chose Strawberry Perl because it includes minGW (a compiler) and a significant subset of the GNU libraries already compiled for Windows. I suspect ActivePerl will also work.

4I want to do graphics, I've chosen the GTK2 library because it's fairly straight forward, it utilises Cairo, it can also render to image files and SVG, and it would make my programs simpler to implement in other operating systems. Using Win32::GUI would tie my work to Windows.

5as noted here by syphilis

PS Semi-final rewrite. Will probably add some more to it later.

If all else fails the Command Prompt U3 can be found on RapidShare too.