Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Packaging my own Perl Module

by Khurrum (Novice)
on Nov 17, 2007 at 05:10 UTC ( #651379=perlquestion: print w/replies, xml ) Need Help??

Khurrum has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to be able to install a couple of Perl Modules on a Windows machine without using ActivePerls PPM. I used PPM before and got my packages from http://trouchelle.com/ppm/. Without having to connect to the internet and using PPM i want to be able to install multiple packages like SOAP::Lite, CONFIG::Auto etc. What i want to do is copy all the .pm files for the above mentioned packages and just install them on the local machine using some sort of script. I can assume that i either have a zip file or a folder containig all the required .pm files.

So i think what i want to do is just like PPM i want to use a PPD file and install a package. I have all the .pm files i need and also the html docs that come but i dont know how to use PPD. I read about Activepersl PPM PPD package but didnt find sufficient information to construct my self a solution.

I dont want to simply copy over the .pm files in the C:\Perl\lib folder i want to do it in the way that PPM does so all the files are stored properly with the correct version and i can test that the package works. Because when i just copy over the files manuall and open the PPM gui it still shows i have SOAP::Lite 0.55 whereas i just copied the files for SOAP::Lite 0.69.

Thanks for the help.

Replies are listed 'Best First'.
Re: Packaging my own Perl Module
by GrandFather (Saint) on Nov 17, 2007 at 06:36 UTC
        Hi thank you for your help. I have looked at the toolkit but i am a little confused. Here is what i want to. I have a script that has to be run on multiple machines and that uses some Perl Packages including Config::Auto, SOAP::Lite now i want to be able to pass my script on to a user on one of the test machines and be able to run it without having to install any Perl packages. It is safe to assume that each machine will have ActivePerl installed.

        Now what i was thinking is to package those modules somehow so my script could be run in conjunction with those modules. Now one solution i initially thought was to get all the PM files, zip them together and then just copy them in the Perl folder on each machine, using a trivial script. The problem i am seeing is that there could be loads of files that would need to be copied so i am not sure how feasible and efficient this solution would be.

        Now you pointed me to PAR and i used the PAR::Packer package and the pp utility to generate a par file using 'pp -p -o output.par input.pl'. I am not sure if i should generate a PAR file or an EXE. With an EXE i think it unzips all the files into a TEMP folder and then deletes them when the EXE stops.

        The other solution is to provide each end user with the output.par file and the script i want to run. I am not sure how the PAR file mechanism works like does it unzip the files somewhere local or something? But the problem with this i have found is that the end user will still need to install the PAR and PAR:Dist packages in order to actually read a PAR file.

        Could you please suggest a solution and correct the things i have misunderstood. Thanks.
Re: Packaging my own Perl Module
by holli (Abbot) on Nov 17, 2007 at 09:41 UTC
Re: Packaging my own Perl Module
by rinceWind (Monsignor) on Nov 17, 2007 at 17:08 UTC

    I see that your preference is to install modules WITHOUT using PPM.

    The alternative is to have installed Visual Studio (at least version 6), just in case you need to compile any extension code. This comes with nmake. If this is on your PC, and you have run vcvars32.bat, you are all set to install modules from CPAN.

    Regarding not having an internet connection, a way round this is to regularly use CPAN::Mini on another machine somewhere that is connected to the internet, and burn CPAN onto a CD.

    If you want to go the route of PPD files for the distributions you want, follow the links others have suggested. If there's any extensions, these will still need building with Visual C++ before you make the PPD.

    If what you have is a self contained application, consider erroneousBollock's suggestion of PAR as a serious alternative.

    --
    wetware hacker
    (Qualified NLP Practitioner and Hypnotherapist)

Re: Packaging my own Perl Module
by ait (Hermit) on Nov 17, 2007 at 17:21 UTC
    I'm not much of a Windows nor an Active State user, but I would suspect there is a way of easily converting a normal CPAN module into a PPM. If not, I guess that by using nmake on Win32 you could install a pure-perl module without much hassle.
    In either case, my suggestion is to look into h2xs (or the newer build module) and make yourself a package of your stuff. The basic structure generated by h2xs is great for changing your mindset into a TDD one, plus you will have make install a lot of other neat stuff. Besides, if your code is useful for other people you can post it in CPAN with little effort.
    If you can, get your hands on "Intermediate Perl" by Randal Schwartz, brian d foy and Tom Phoenix (O'Reilly ISBN 0-596-10206-2). Chapters 10 through 16 will give you all you need to make and publish your stuff (even if for oneself). All it takes is a few hours of reading and you will have your "installable" modules in no time.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-12-03 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (27 votes). Check out past polls.

    Notices?