On Fri, Dec 19, 2008 at 11:07, Rex <perlici...@gmail.com> wrote:
> Pardon me, if this has been already raised. I have experience in
> ActivePerl from Activestate. However, I have a Cygwin for Windows,
> where Perl 5.10 is installed. I am not familiar with CPAN. I did go
> through some stuff at the CPAN site. But, I really want to get started
> on some basic tasks that has to do with Perl on Cygwin.
>
> 1) How should I install new modules? (in ActivePerl, I do "ppm install DBI")

cpan DBI

an important difference from ppm, the name you give is the actual module name:

cpan DBD::SQLite

vs

ppm install DBD-SQLite

> 2) How do I know about the modules already installed? (in ActivePerl,
> I do, "ppm query")

perl -MModule::Name -e 0

If you get an error then the module isn't installed

> 3) What is this "install" or "make" or "test" that seems to be the
> norm in CPAN? When I tried to do "install DBI", it bombed on a fatal
> error saying the DLL cannot be installed or something like that. Is
> this how I install a new module?

Unlike ppm, CPAN modules need to be made.  This can be either a
trivial or lengthy process depending on the module.  The standard
process for making a module (which is automated by the cpan command)
is

1. perl Makefile.PL
2. make
3. make test
4. make install

Step 1 checks to see if all of the module's dependencies are installed
and writes a Makefile.  Makefiles are instructions to a utility named
make that tell it how to build the module, which is why running make
is step two.  Makefiles contain targets.  When you run make with no
arguments it builds the default target (the module), but there are
other targets.  In the case of step 3, you are asking make to build
the test target.  This target traditionally will run through a set of
tests to make sure the code works.  Finally, if the tests succeed, you
tell make to build the install target which installs the module in the
directory that was specified during step 1 or one of the default
directories.

If you get an error building a module from CPAN, either contact the
author or post the error to this list.


-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to