Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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:

  • Windows sometimes randomly chooses to recognise file ownership or something and won't let the script update the config files. Restore the originals and restart the command prompt and it works again.
  • cpan sometimes leaves it's lockfile locked and can't reset it. Delete it and try again and it's fine.
  • Any CPAN configurations in your C:\Documents and Settings\Username\Local Settings\Application Data\.cpan will override the settings elsewhere, including your stick. Delete that too...
  • Using o conf in CPAN will often make the config file unreadable/unwritable to the script. Delete it, restore backup...
  • Using CPAN's autoconfig can be unpredictable. If it shows up the script failed. Fix whatever caused that first. ...you might also consider restoring those backups too...
  • Flattening the include libraries doesn't help with the compiling. Mostly it seems to be Makefile or Makefile.PL that have shell components that fail... or more likely dependencies I don't have. At least you don't have to restore the backed up config files.

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.


In reply to RFC: Perl-onna-Stick by Bloodrage

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-18 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found