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

Adding CPAN Modules to Active State Perl

by jlk (Hermit)
on Feb 26, 2002 at 21:04 UTC ( [id://147727]=perlquestion: print w/replies, xml ) Need Help??

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

I have recently downloaded the latest Active State Perl for windows NT and have installed it. Unfortunately, this is my only option here at work for playing with Perl. My main objective is to try and get the Win32-GUI chat running so that I don't have to keep clicking on 'talk'. Well, in learning to install a module in Active State I ran into something rather curious. Is it possible to install a module in Active State Perl that is downloaded from CPAN instead of Active State's PPM archive? It works fine when I download from Active State and the zipped package contains a '*.ppd' file to tell the package manager about all the packages in the repository, but I cannot figure out if it is possible to install a module from CPAN instead. Any one have any ideas? Thank you in advance!!!



#jlk


Seasame street was brought to you today by the letters M, I and T and the number 3.1415926535897932384626433832795

Replies are listed 'Best First'.
(Ovid) Re: Adding CPAN Modules to Active State Perl
by Ovid (Cardinal) on Feb 26, 2002 at 21:31 UTC

    This is usually fairly easy (unless you get a module that requires you have a C++ compiler installed). Download the module and unzip it. Then, you grab nmake and install that (when you run nmake for the first time, it will create some files that you can just copy to a directory in your path. Once that's done, you can just follow the typical install:

    perl Makefile.PL nmake nmake test nmake install

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      You make it sound so simple. - I have the module unzipped on my Desktop - I have nmake lying on my Desktop Where should these files go? Where should I execute the make commands? Please advise in a granular fashion. Best, wirefree
Re: Adding CPAN Modules to Active State Perl
by ajt (Prior) on Feb 26, 2002 at 21:52 UTC
    You can install modules downloaded from CPAN onto ActiveState Perl without too many problems. You will need some extra bits though:
    • You need to be able to unpack .tar.gz files, WinZip can manage this- amongst others, and you can get command line tar and gnuzip for windows too - Cygwin is a good place for this.
    • You also need a copy of make. ActiveState built Perl with Microsoft's tools so you will need Microsoft's make program, called nmake that you can get from here.
    • If the module requires XS (c/c++ stuff) then you will need a copy of Visual C, however most do not, so you should be okay for most things.
    • Basically once you have downloaded the file, unpack it and follow the instructions - remembering that it's nmake not make.

    Don't forget that there is the Perl Package Manager can use other archives than just the default ActiveState one, see Re: Modules in the Windows environment for more details.

    Happy hunting

Re: Adding CPAN Modules to Active State Perl
by data64 (Chaplain) on Feb 26, 2002 at 22:13 UTC

    There are other ppm repositories you can look at. See Re: Modules in the Windows environment and tombstone 163

    You can also install the CPAN module from cpan using the method that Ovid describes and it will automatically download and install modules that do not require a C compiler(unless you have Visual C++ installed).

    If you do install modules outside of ppm, note that the html documentation (atleast the TOC) does not get automatically updated. Fortunately, Rudif put together Update HTML Doc to fix that.


    <cite>Just a tongue-tied, twisted, earth-bound misfit. -- Pink Floyd</cite>

Re: Adding CPAN Modules to Active State Perl
by dvergin (Monsignor) on Feb 26, 2002 at 22:20 UTC
    "But," you ask, "how do I know if a CPAN download is Pure Perl."

    This might be a good place to mention a bit of cruft called PurePerl.pl which will answer that question with reasonable accuracy.

    ------------------------------------------------------------
    "Perl is a mess and that's good because the
    problem space is also a mess.
    " - Larry Wall

Re: Adding CPAN Modules to Active State Perl
by smitz (Chaplain) on Feb 27, 2002 at 00:02 UTC
    My condolences, I'm also forced to use perl on Win when not at work, but after some tinkering, its not that bad. A few pointers I wish I'd known long ago:
    1. The cpan module works fine on windows, try this: perl -MCPAN -e shell
    2. nmake really is awful from your point of view, it cant cope with some of the most basic make commands. If you can afford the ($$$|space), get Visual C.
    3. oh yeah, the cpan module sorts out unzipping and taring for you, so dont worry about that.

    Hope these put you in the right direction,
    SMiTZ
Re: Adding CPAN Modules to Active State Perl
by erikharrison (Deacon) on Feb 27, 2002 at 04:50 UTC

    As long as we're asking about Active State Perl and the CPAN . . .

    I've had Active Perl for about three months, and I've use the PPM effectively, and when I've had to go get stuff from the CPAN I've just downloaded the .tar.qz, unzipped it to a temp directory, and moved it to the appropriate place. The way we talk about nmake and the like I wonder what's wrong with this method. I suspect that it has something to do with modules that are interfaces to bit of C or the like, but I can't actually find an explanation in the docs, which are somewhat *nix centric and assume you know what make does.

    I'd appreciate an explanation.

    Cheers,
    Erik
      It depends on whether the module contains any C code. If this is the case, the glue between perl and C is usually XS (though SWIG is also available). An output of these tools is the file makefile.pl.

      When you run this perl code, it uses ExtUtils::MakeMaker to produce a makefile (= make script) for the platform on which you are running. This file (called MAKEFILE on Win32) contains dependency rules to build the software (nmake), test it (nmake test) and install it (nmake install).

      On CPAN, all modules are packaged up to use makefile.pl, hence the installation instructions are nearly always the same, saving you having to grok the readme file every time.

      You don't need to know the syntax of a makefile to use it, but this is useful when the build breaks - usually because the author has made some assumptions about file path syntax (Grrr :-{).

      In terms of getting a make tool that works, nmake is your best bet, as described by Ovid

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-29 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found