[Melbourne-pm] Strawberry Perl and PAR (was Re: Run Perl Script from HTML)
toby.corkindale at strategicdata.com.au
Thu Sep 24 19:31:57 PDT 2009
Daniel Pittman wrote:
> scottp at dd.com.au writes:
>> Instead of active state, consider strawberry Perl & par
> Ah, a recommendation for those tools! Excellent!
> That presumably means that you have worked with them. Other than the standard
> PAR problems, like five-year-old bugs causing it to do the wrong thing when it
> comes to detecting changed libraries, how well does this work?
For those of you curious about this particular PAR bug..
PAR caches the contents of the archives, and is meant to detect if the
cache is up-to-date by a checksum. Unfortunately a very-long-standing
issue with PAR is that it checksums $0 (well, argv actually), rather
than the actual .par file.
Now, if you're distributing a self-contained .exe with your application,
then this is acceptable behaviour.. since your .exe will change every
time you build a new version, and thus the checksum will change, and the
new version of your app will run.
However if you run your app via "parl myapp.par" instead, perhaps
because you have a selection of Perl scripts you'd like to run in it,
then you'll only ever get the first version you distribute..
(Because it's checksumming parl, not myapp.par. Whoops.)
The pure-perl implementation of PAR does the right thing, and thus both
the following methods also work correctly:
use PAR 'myapp.par';
perl -MPAR myapp.par
More information about the Melbourne-pm