http://www.perlmonks.org?node_id=556613


in reply to PAR packaging

Hi,

I have constructed a simple test which does what you want but does not reproduce your problem:

Put this in t.pl:

#!/usr/bin/perl use strict; use warnings; use lib '.'; use PAR qw/t.par/; use MyModule; print "\nbar\n";

And put this in the subdirectory lib in the file MyModule.pm

package MyModule; print "foo"; 1;

Now run this command:

PERL5LIB=lib pp -o t.par -p -v t.pl -M MyModule

Explanation:

Does this work for you? If not, please tell me what OS you are on, what version of PAR you are using and what version of perl you have. This was PAR 0.941, perl 5.8.7 on kubuntu/dapper/x86_64.

Finally a little explanation of your strace output. (I'm not an expert on strace, though.) The file 1ec196d6.pm is a filename-mangled version of one of the modules PAR uses internally. To find out which one it is, open it with an editor and look for the "package" declaration. Now, the fact that it is put into the 1/ subdirectory of the cwd() is most certainly a PAR bug. I will investigate that and appreciate any feedback.

Hope this helps,
Steffen

Replies are listed 'Best First'.
Re^2: PAR packaging
by rootcho (Pilgrim) on Jun 21, 2006 at 23:05 UTC
    ok...thank you very much, will try your suggestions and will post the results..
Re^2: PAR packaging
by rootcho (Pilgrim) on Jun 23, 2006 at 23:16 UTC
    hmm, now after i read more carefully what u wrote.. i don't want to do exacactly what u specify
    I want MyModule.pm and myscript.pl to be outside of the .PAR so that i can change them often. And i want to use the .PAR for all of the CPAN modules we use.
    'Cause we don't own the boxes were the scripts will be, it will be alot easier for use to deploy the scripts if common CPAN modules can be in a .par.
    Now on the script...just for this reason I first use :
    use FindBin qw($Bin); use lib $Bin . "lib"; use MyModule;
    and then :
    use PAR '/path/to/test.par';
    So that the script can find the module, outside the .par.
    But as I already said when I execute the script outside the .par, I'm getting this 100%-cpu usage on stat64() call.
    OK, i contunued my investigation to see exactly which is this 1ec196d6.pm module, after I checked the cache the file is the HTML::HeadParser module.
    Now the more interesting part ;) If i go into the .par, delete this module from archive and start myscript.pl runs w/o a problem