rkg has asked for the wisdom of the Perl Monks concerning the following question:

Hi --

I have bundled a script and some modules using PAR on WinXP (Home):

pp -o myapp.exe myapp.pl
My app uses command line parameters:
perl myapp.pl -in foo.txt -verbose -out bar.txt
I am getting flaky results. Sometimes when I run
myapp.exe -in foo.txt -out bax.txt
or
myapp -in foo.txt -out bax.txt
I just get back a dos command prompt -- nothing happens. Sometimes it runs, sometimes it just chooses not to do anything. No errors, just a dos prompt back w/o any program activity.

I am unable to determine a pattern as to when it works and when it does not.

Anyone have ideas? Is this a PAR problem, or is a WinXp issue?

rkg

UPDATE

I have noticed that if the .exe runs once, then on subsequent tries it will run no more. It is as if something is getting cached somewhere... befuddled, help sought!

janitored by ybiC: Rename from "PAR" to facilitate better searching

Replies are listed 'Best First'.
Re: PAR, commandline args, WinXP
by PodMaster (Abbot) on Nov 16, 2003 at 18:49 UTC
    Which version of PAR do you have? The problem is most likely with your code (i tested with "Perl Packager, version 0.05 (PAR version 0.76)", had no problems).

    update: here's a thought, your env PATHEXT variable wouldn't happen to have .pl in there? You could be running the .pl version when you think you're running the .exe version ... name your executable something else (read `perldoc perlwin32', `ftype /?', `assoc /?').

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Running PAR 0.75. Don't have a PATHEXT in my enviroment. .pl mapped to Optiperl. I don't think the .pl version is running; it would chatter to STDOUT. As should the .exe version.

      Still stumped, still appreciative of any addntl ideas...

      ==================== Name: PAR Version: 0.75 Author: Autrijus Tang (autrijus@autrijus.org) Title: PAR Abstract: Perl Archive Tookit InstDate: Sun Nov 16 12:31:52 2003 Location: http://ppm.ActiveState.com/cgibin/PPM/ppmserver-5.8-windows. +pl?urn:/PPMServer Prerequisites: 1. Module-ScanDeps 0.0 2. Archive-Zip 0.0 3. PAR-Dist 0.05 Available Platforms: 1. MSWin32-x86-multi-thread-5.8 ====================
Re: PAR, commandline args, WinXP
by rkg (Hermit) on Nov 16, 2003 at 20:27 UTC
    Perhaps noteworthy:
    • I extend my perl module path with PERLLIB in my environment... is PAR smart enough to pick that up?
    • I have a BEGIN block that looks at @INC and modifies some constants based on the directory structure it discovers there... could that be clashing with PAR?
      I extend my perl module path with PERLLIB in my environment... is PAR smart enough to pick that up?
      I can't speak definitively, but it appears so (PAR isn't being smart, and this may be a bug)
      C:\dev\LOOSE>cat par.inc.t print " here are the \@INC buddy @INC "; C:\dev\LOOSE>perl par.inc.t here are the @INC buddy honk C:/Perl/lib C:/Perl/site/lib . C:\dev\LOOSE>pp par.inc.t C:\dev\LOOSE>a.exe here are the @INC buddy CODE(0x12e317c) honk . C:\dev\LOOSE>

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        PAR works by putting a code reference at the start of @INC. Putting something else there (through environment variables) may indeed cause problems.

Re: PAR, commandline args, WinXP
by rkg (Hermit) on Nov 17, 2003 at 00:53 UTC
    UPDATE

    This has something to do with "Compatibility Mode" (under "properties" of the exe) -- it works fine if I set the mode to Win95.

    Ack.

    Anybody what all this means, and / or how to set this flag programatically thru perl? I want to run pp on set of perl scripts to make  .exe versions of all of them for bundling for release...

    Suggestions?

    windows--,

    rkg