Painless Windows Module Installation with PPM
by Josh Stroschein
|
Pages: 1, 2, 3
Registering a Repository
Creating a local repository requires just a few commands. From within the PPM program type:
rep add <name> <location>
Suppose that you have created the packages directory at C:\Perl\bin\packages. You have also created the x86 directory inside the packages directory: C:\Perl\bin\packages\x86. When you perform a search with PPM, it queries the PPD files. More specifically, it queries the metadata inside the XML of the PPD file, matching the title tag against your search. Executing:
ppm> rep add MyRep C:\Perl\bin\packages
... creates a repository named MyRep that uses PPD files in the packages directory. After this command completes, check to see that it's now in the repository list:
ppm> rep
Repositories:
[1] ActiveState Package Repository
[2] ActiveState PPM2 Repository
[3] MyRep
This will return a list of all the available repositories. You should now see the repository that you just created, which will be set to active by default. The numbers in the list serves two purposes: the first is to define the order in which the search executes. PPM searches first the repository at position one, followed by two, and so forth. Second, it eases the management of the repositories much in the same way it eases installing modules. Instead of referring to a repository by name, you can refer to it by its number.
A More Public Repository
The new local repository is only accessible by the machine where it resides. If desired, you can modify the PPD files and the steps involved in creating a repository to use an HTTP-based repository over a local network. You could use this repository outside of an installation package to manage and provide module access over a large network. For a straight-forward HTTP-based repository, all you need is a web-server accessible to a local Intranet or over the Internet.
Even though I did not implement an HTTP-based repository, is well worth covering a simple setup. This essentially involves creating two repositories: one on the server and the other on any PC. I chose the Windows version of the Apache 2 web server. After a default installation of Apache 2, I configured it as a repository. There are only a couple of steps involved to accomplish this.
By default, Apache serves its pages from C:\Program Files\Apache2\htdocs.. I created the repository directories as previously discussed: C:\Program Files\Apache2\htdocs\packages\x86. As long as the packages directory is web-accessible, it will allow the server to act as a simple web-based repository. If you don't plan to run PPM on the server then the ActivePerl installation is not even necessary. Now when you create a repository, if you supply the url to the server instead of a directory path it will access the repository over the network or Internet. To create a web-based repository in PPM, type:
ppm> rep add <name> <url>
Now the PPM program on that machine will be able to search the modules available on the repository located at the specified URL.
In order to test the installation of the repository, I usually disable the other repositories. There are multiple ways to do this, but I find it easiest to turn off the repositories. This keeps the repository available on the system; however, PPM will not use them when you perform a search. To disable searching of the repository at position two, type:
ppm> rep off 2
Repositories:
[1] ActiveState Package Repository
[2] MyRep
[ ] ActiveState PPM2 Repository
You can also remove a repository from your system:
ppm> rep delete <name or num>
This will completely remove that repository from the system. Removing a repository is safe if you are confident that you will not use that repository again.
Maybe you are not sure if a repository is active. Listing the repositories on your system will provide the information you need to know if a repository is active:
ppm> rep
[1] ActiveState Package Repository
[2] MyRep
[ ] ActiveState PPM2 Repository
If there is not a number assigned to a repository, then it is not active. In this example, the ActiveState PPM2 Repository is still configured on the system but it is not active, so PPM will not search through it. To begin searching it again, all you need to do is to reactivate it:
ppm> rep on ActiveState PPM2 Repository
Conclusion
PPM is a small but useful program for managing Perl modules needed on your systems. It provides a simple command line interface and the capability to customize the way it searches for modules. PPM allowed me to install the modules I needed without relying on Internet access. This led to the creation of an installation package that was truly Internet independent. It also enabled me to create an installation package that was completely automated, requiring no user interaction.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 9 of 9.
2009-04-29 23:52:41 freedomman [Reply]
Hi
I want to write perl code to install some perl modules automatically, I do it to make other people use my perl code but not need to install these modules by themselves. how can I realize this function?
- how to create Perl module using PPM
2008-02-21 22:59:35 ShanthiBandari [Reply]
Hi
As i am new to the PERL,wants to know how to create a perl module using PPM,and how to install it.
I want to know the creation and installation of Perl module.So,please can you help me out ASAP...
Many Thanks
- Hello
2007-09-09 23:15:20 sugam.sharma [Reply]
Hi Guys.
Some time ago I put a requesting message seeking some help in Perl Robot Programming to connect to pubmed database.
But I have designed that perl robot program and it is successfully connected to pubmed database.
And fetches the required data accurately.And I have written an abstract on this novel work and soon It will be submitted to online journal in pubmed/springer.
If any one need my assisstance
please do write me
sharmasugam@aol.ocm
Sugam Sharma
TrentLott Geospacial & Visualization
Research center
Mississippi
USA
- Hello
2007-09-09 23:13:57 sugam.sharma [Reply]
Hi Guys.
Some time ago I put a requesting message seeking some help in Perl Robot Programming to connect to pubmed database.
But I have designed that perl robot program and it is successfully connected to pubmed database.
And fetches the required data accurately.
If any one need my assisstance
please do write me
sharmasugam@aol.ocm
Sugam Sharma
TrentLott Geospacial & Visualization
Research center
Mississippi
USA
- Perl Robot Programming
2007-08-03 21:38:30 sugam.sharma [Reply]
Hi,I am writing a perl script for Robot to connect to the pubmed database.But I am facing one problem regularly i.e. LWP::UserAgent needs to proxy the stuff for the concern website. And this happens twice one during reguest and other responce.
- perl Modules for windows
2007-01-22 21:28:50 r_karthikeyan [Reply]
how to get all the perl modules for windows. most of the modules are not included. get a solution for this problem
Thanks in advance,
karthikeyan- perl Modules for windows
2007-02-05 13:57:18 AdamKennedy [Reply]
One other solution would be to use a Windows Perl that comes with an integrated compiler, such as Strawberry Perl.
For these the CPAN client works the same way as it does on Unix.
- perl Modules for windows
2007-01-25 16:11:36 chimaera23 [Reply]
There really is no simple solution that I know of. Cpan.org is the best place to search for modules, but not all of them are windows compatible. One method would be to find the ones you want and try installing them, either through PPM or by using nmake. You can also use the PPM program to search for modules you need, as I have mentioned in the article. Once you find all the modules that you'll need, you can download them and create your own repository.
As for finding an installation of Perl that is bundled with all the modules that you need, that is beyond the scope of my article. However, that is the exact reason why I ended up creating my own repository. I created my own installation wizard that installed not only Perl, but all of the modules I needed that didn't come with the standard Activestate distro. Hope this helps.
~Josh
- perl Modules for windows
- PPM installed modules before/after an upgrade
2007-01-21 11:48:06 briankx0 [Reply]
Thanks for the article. I once created a local repository, but forgot how to use it. For me, upgrading ActivePerl was the immediate concern.
What to do when upgrading ActivePerl (on Windows after adding modules with PPM) is documented. I'm happy with the setup.
When it comes time to upgrade Perl, one need not download all non-ActiveState modules again. From the ActivePerl User Guide | Getting Started | Installation Guide | Installing ActivePerl on Windows (x86) | Upgrading from ActivePerl 5.8.x.
"...
Upgrading from ActivePerl 5.8.x
If you have installed modules using the PPM included with earlier versions of ActivePerl 5.8, use the following steps to upgrade ActivePerl. PPM modules can only be migrated to later ActivePerl builds if you installed ActivePerl using the MSI Installer.
1. Use Window's Add / Remove Programs applet (accessible from the Control Panel) to uninstall ActivePerl.
2. Manually delete all directories beneath the Perl installation directory (by default C:\Perl) except the site\lib directory.
3. Install ActivePerl to the same directory (i.e., C:\Perl).
4. Use the ppm upgrade command to check for module updates.
...."
Brian



