Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Using PAR for a relocatable environment

by tsee (Curate)
on Apr 19, 2007 at 14:00 UTC ( [id://610953]=note: print w/replies, xml ) Need Help??


in reply to Using PAR for a relocatable environment

If you intend to create .par archives from lots of CPAN distributions, I suggest you have a look at the PAR::Dist::FromCPAN module and the cpan2par tool accompanying it. It started out as a quick and dirty tool I used for testing PAR::Repository, but it should be quite usable now. Theoretically, it can even follow arbitrary CPAN dependencies. One exception are modules using Module::AutoInstall which break the CPAN.pm dependency checking itself. (Read: They're broken.)

In fact, your use case kind of sounds like you could have a look at PAR::Repository / PAR::Repository::Client, too. Just keep in mind that PAR::Repository (the administrative interface which can inject new .par's into the repository) doesn't run on win32 because it needs symlinks.

The basic use case of PAR::Repositories on the client side is as follows:

use strict; use warnings; use PAR { repository => 'file:///path/to/repository/on/nfs/' }; # or: # use PAR { repository => 'http://repository/url' }; use Foo; # Foo loaded from the repository if not found locally.

For finer-grained control, you can eschew the interface using PAR and create your PAR::Repository::Client by hand. That way, you can use it to locally install and update the distributions instead of fetching them from the repository, etc.

On a side note: you can embed arbitrary data files (i.e. CSS/HTML) into a .par and have them extracted when the .par is loaded. You would find them in the $ENV{PAR_TEMP} directory or so. (The PAR::Environment POD has the details on all the environment variables PAR uses. If in doubt, test.)

In the hope this helps,
Steffen

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://610953]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-26 06:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found