Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

PARoblems (problems with PAR)

by Dr. Mu (Hermit)
on Feb 25, 2005 at 07:25 UTC ( [id://434398]=perlquestion: print w/replies, xml ) Need Help??

Dr. Mu has asked for the wisdom of the Perl Monks concerning the following question:

I'm just now dipping my toes into PAR. I can't say it's been pleasant, but I'm determined to make it work.

Problem #1: I have my own library of modules that I specify with a  use lib. (This library exists on a networked drive.) These modules refer to other modules in the standard Perl library. Running the program via perl.exe works fine. But when I try to run the exe that pp creates, I get errors in the use and require statements that refer back to the standard modules, viz:

Can't locate Tk/Pane.pm in @INC (@INC contains: //phil/c/perl/job CODE +(0xa45dc8) ... .) at [the "require Tk::Pane" statement] ...
There's no mention of /perl/site/lib in @INC at this point.

Problem(s) # 2: I almost hesitate to mention this, as it's so off the wall. Sometimes pp errors out with:

Can't spawn "C:\Perl\bin\parl.exe": Bad file descriptor at c:\Perl\bin +/pp line 372.
Oddly enough, all I have to do is run it again once or twice more, and I won't get the error. But here's the really nutty part: the exe files it generates exhibit the same non-determinism. About 75% of the time when I execute one, it doesn't do anything -- just returns to the command line. The other 25% it will run just fine. I can endure a lot of grief, but this one will aggravate my customers, and that's bad.

So, weird stuff. Any ideas?

Update: I finally got the program to run by copying all the files to the XP host machine, deleting the use lib pragma from all but the main program, and adding some requires to the main program for Tk stuff. Setting the PAR_CLEAN environment variable didn't help with the non-deterministic stuff, I'm sorry to say. But now, when I transport the exe back to a Win98 machine and try to run it, I get a page fault in EVENT.DLL. This occurs even when I include perl58.dll in the exe file's directory. (The Win98 machine has a perl 5.6 installation.) I hate to say it, but I'm about ready to bag PAR and spend another chunk of change on a new perl2exe license. At least I know it works...

Update 2: I retitled the node, adding the parentheticals, in accordance with a suggestion by jdporter. This will make it possible to search using the keyword "PAR".

Update 3: Went back to perl2exe. It's not as good as PAR at rooting out dependencies, so I had to add some more requires. But, other than that, it works out of the box -- as do its executables. I haven't totally given up on PAR, but this isn't a hobby, and I don't have the time to fuss with it just now.

Replies are listed 'Best First'.
Re: PARoblems
by Koosemose (Pilgrim) on Feb 25, 2005 at 10:43 UTC

    As far as your first problem goes, older versions of PAR (perhaps the more recent ones also, I'm not sure) have troubles with Tk due to it pulling in it's sub modules only when they are used, you simply need to specifically require any specific Tk Modules you are using instead of relying on Tk Itself to autoload them.

    Just Another Perl Alchemist
      I've had the same experience with PAR 0.85. Moreover, at least one module (Tk::Bitmap specifically, which is used in the getSaveFile() calls) needed to be specified explicitly as a use because otherwise, I would get errors similar to yours.
Re: PARoblems
by rinceWind (Monsignor) on Feb 25, 2005 at 14:34 UTC
    Can I suggest that you post this to the PAR list; I know that the people there would be most interested.

    Problem #1

    This looks like a build problem with pp. Use unzip -l (or winzip on windows) to list out the contents of the PAR "executable". All modules that you need at run time should be there. You need to add explicitly any that are omitted as "-M" options to pp.

    Problem(s) # 2

    This kind of intermiitent stuff looks like a caching problem. At a cost of a slower crank-up time, try running with $ENV{PAR_CLEAN} set to 1.

    Hope this helps.

    --
    I'm Not Just Another Perl Hacker

Re: PARoblems
by tphyahoo (Vicar) on Feb 25, 2005 at 10:22 UTC
    Extremely wild guess, but frustratingly inconsistent and irreproducible results make me suspect either file permissions or firewalls. For instance, where I work, there's a networked drive protected with Norton Personal firewall, and sometimes this prevents me from accessing the drive, due to a bug in NPS. Tracking this down drove me nuts. Something along these lines maybe?

    I know nothing about par.

Re: PARoblems
by audreyt (Hermit) on Feb 25, 2005 at 22:10 UTC
    Greetings. It seem that you are using a truly old version of PAR, becuase pp line 372 has been in POD chunks for quite a while now. Can you try again with PAR 0.87?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://434398]
Approved by Paladin
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found