Discussion:
How to install perl modules?
Manuel Tejada
2005-05-25 03:35:49 UTC
Permalink
Hello!

Somebody can tell me from what URL I must to download
a perl module and how to install it in Cygwing?

In pure Windows is easy is you have Perl from
ActiveState but Perl installed in Cygwin doesnt have
the ppm Manager.

Manuel TEJADA M.

_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
Brian Dessent
2005-05-25 03:52:02 UTC
Permalink
Post by Manuel Tejada
Somebody can tell me from what URL I must to download
a perl module and how to install it in Cygwing?
You use CPAN. "perl -MCPAN -e 'install Foo::Bar'" or "perl -MCPAN -e
shell". There is no URL to know, it takes care of all of that.
http://cpan.org/misc/cpan-faq.html
Post by Manuel Tejada
In pure Windows is easy is you have Perl from
ActiveState but Perl installed in Cygwin doesnt have
the ppm Manager.
To me (and perhaps others) that's a feature and not a bug. I can't
stand that ppm junk.

Brian
Yitzchak Scott-Thoennes
2005-05-25 10:30:18 UTC
Permalink
Post by Brian Dessent
Post by Manuel Tejada
Somebody can tell me from what URL I must to download
a perl module and how to install it in Cygwing?
You use CPAN. "perl -MCPAN -e 'install Foo::Bar'" or "perl -MCPAN -e
shell". There is no URL to know, it takes care of all of that.
http://cpan.org/misc/cpan-faq.html
Note that there's the cpan script also:

install a module:
$ cpan Foo::Bar

or

start the cpan shell:
$ cpan

To install a module, you'll have to have the make package installed
(by cygwin's setup.exe program; it's in the Devel category).

To install a module with xs components, you'll need at least the gcc
package.
Gerrit P. Haase
2005-05-25 09:04:12 UTC
Permalink
Post by Manuel Tejada
Hello!
Somebody can tell me from what URL I must to download
a perl module and how to install it in Cygwing?
To browse the CPAN (Comprehensive Perl Archive Network)
manually use http://www.cpan.org/ and http://search.cpan.org/ .
Post by Manuel Tejada
In pure Windows is easy is you have Perl from
ActiveState but Perl installed in Cygwin doesnt have
the ppm Manager.
Windows needs it because they do not have a compiler by default.
Cygwin has its own compiler and you use the CPAN module which
is much better since it also takes care about the dependencies
of modules.

Type `cpan' in a Bash shell and follow the instructions.


Gerrit
--
=^..^=
Jason Pearce
2005-05-25 10:55:59 UTC
Permalink
Yes, use the CPAN module as Brian suggests. Just make sure environment
variable PERLIO is unset when using -MCPAN, otherwise it will fail. (You
might set this to CRLF for DOS compatibility purposes).
Also be aware that you may have trouble building some modules that use C
code and have not been ported to Cygwin, mainly OS modules like WIN32.
Straight Perl modules should just work out of the box, and CPAN will get
all pre-requisites for you too. You'll never want ppm again!

Regards,
Jason
Post by Brian Dessent
Post by Manuel Tejada
Somebody can tell me from what URL I must to download
a perl module and how to install it in Cygwing?
You use CPAN. "perl -MCPAN -e 'install Foo::Bar'" or "perl -MCPAN -e
shell". There is no URL to know, it takes care of all of that.
http://cpan.org/misc/cpan-faq.html
Post by Manuel Tejada
In pure Windows is easy is you have Perl from
ActiveState but Perl installed in Cygwin doesnt have
the ppm Manager.
To me (and perhaps others) that's a feature and not a bug. I can't
stand that ppm junk.
Brian
George
2005-05-26 06:51:41 UTC
Permalink
Post by Jason Pearce
Yes, use the CPAN module as Brian suggests. Just make sure environment
variable PERLIO is unset when using -MCPAN, otherwise it will fail. (You
might set this to CRLF for DOS compatibility purposes).
Also be aware that you may have trouble building some modules that use C
code and have not been ported to Cygwin, mainly OS modules like WIN32.
Straight Perl modules should just work out of the box, and CPAN will get
all pre-requisites for you too. You'll never want ppm again!
Sorry to go off on a slight tangent here, but is there any documentation
anywhere that describe which Win32 modules are problematic, as it's most
likely that for Cygwin users the Win32 modules are of particular
interest, no? And installing both Cygwin's Perl and ActiveState's
distribution can offer a less than satisfactory solution as it presents
its own set of problems.
--
George
Gerrit P. Haase
2005-05-26 20:11:50 UTC
Permalink
Post by George
Post by Jason Pearce
Yes, use the CPAN module as Brian suggests. Just make sure environment
variable PERLIO is unset when using -MCPAN, otherwise it will fail. (You
might set this to CRLF for DOS compatibility purposes).
Also be aware that you may have trouble building some modules that use C
code and have not been ported to Cygwin, mainly OS modules like WIN32.
Straight Perl modules should just work out of the box, and CPAN will get
all pre-requisites for you too. You'll never want ppm again!
Sorry to go off on a slight tangent here, but is there any documentation
anywhere that describe which Win32 modules are problematic, as it's most
likely that for Cygwin users the Win32 modules are of particular
interest, no? And installing both Cygwin's Perl and ActiveState's
distribution can offer a less than satisfactory solution as it presents
its own set of problems.
There is an up to date version of libwin32 as well as Win32CORE included
in the perl distributed, it *should* be possible to build some (not all)
of the Win32 modules, though I have not tried to build much of them.
Just try one or another if it is not already included with libwin32.


Gerrit
--
=^..^=
George
2005-05-27 04:50:32 UTC
Permalink
Post by Gerrit P. Haase
Post by George
Post by Jason Pearce
Yes, use the CPAN module as Brian suggests. Just make sure
environment variable PERLIO is unset when using -MCPAN, otherwise it
will fail. (You might set this to CRLF for DOS compatibility
purposes). Also be aware that you may have trouble building some
modules that use C code and have not been ported to Cygwin, mainly
OS modules like WIN32. Straight Perl modules should just work out
of the box, and CPAN will get all pre-requisites for you too. You'll
never want ppm again!
Sorry to go off on a slight tangent here, but is there any
documentation anywhere that describe which Win32 modules are
problematic, as it's most likely that for Cygwin users the Win32
modules are of particular interest, no? And installing both Cygwin's
Perl and ActiveState's distribution can offer a less than
satisfactory solution as it presents its own set of problems.
There is an up to date version of libwin32 as well as Win32CORE
included in the perl distributed, it *should* be possible to build
some (not all) of the Win32 modules, though I have not tried to build
much of them. Just try one or another if it is not already included
with libwin32.
I guess I'll see how it goes, then. The triumph of optimism over
experience.

To get this thread a bit back to topic, I do distinctly remember having
problems building several modules and encountered a mess of problems
that seemed as attributable to cpan as anything else, so I wrote off the
whole approach and went back to using ActiveState's Perl. Now that I'm
relying solely on the Cygwin distribution, I'm finding everything thus
far going swimmingly well, and cpan indeed works as described above.

Again, thanks for the reply.
--
George
Reini Urban
2005-05-27 07:16:52 UTC
Permalink
Post by Gerrit P. Haase
Post by George
Sorry to go off on a slight tangent here, but is there any documentation
anywhere that describe which Win32 modules are problematic, as it's most
likely that for Cygwin users the Win32 modules are of particular
interest, no? And installing both Cygwin's Perl and ActiveState's
distribution can offer a less than satisfactory solution as it presents
its own set of problems.
There is an up to date version of libwin32 as well as Win32CORE included
in the perl distributed, it *should* be possible to build some (not all)
of the Win32 modules, though I have not tried to build much of them.
Just try one or another if it is not already included with libwin32.
For some time I did automatic cpansmoke testing on cygwin for every new
module (CPANPLUS, perldoc cpansmoke), and it turned out that almost none
of the non cygwin-supported Win32 XS modules compile and work fine.
Mostly because Win32 modules are written for nmake/msvc only and
maintainers usually dont accept cygwin/mingw patches.

libwin32 and Win32::GUI is doing fine but the cygwin patches are not yet
accepted upstream. For libwin32 this will need some time.
Win32::API has no callback support with the latest updates.
For 0.26 there's a cygwin version.

There's a statistic:
http://testers.cpan.org/letter/W.html

I believe I have to re-enable my cpansmoke filter for cygwin, because
there're so many cygwin tests missing under the Win32 tree.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
http://phpwiki.org/
Linda W
2005-06-02 04:58:24 UTC
Permalink
FYI -- I discovered the cause of a problem I had in manipulating the
Registry. There is a bug in the Win32 Registry manipulation routines.
Both TieRegistry and the original Registry interface apparently
use an older interface -- something like (?), libcalls ending with "A"
where new ones end with "W". The "A" interface was for 8-bit characters.
The "W" interface works with the 16-bit characters in the registry.

While it was thought this might have been due to "bogus" registry entries,
according to the MS registry documentation, the only illegal character
in a registry "name" is "\". This causes perl to fail when manipulating
some binary key- & value- names.

I don't know which other routines still use the older 8-bit character
calls, but there may be similar problems if they use the older
interface. Note that these modules are broken in the ASPN version
of perl as well.
Post by Gerrit P. Haase
Post by George
Post by Jason Pearce
Yes, use the CPAN module as Brian suggests. Just make sure
environment variable PERLIO is unset when using -MCPAN, otherwise it
will fail. (You might set this to CRLF for DOS compatibility purposes).
Also be aware that you may have trouble building some modules that
use C code and have not been ported to Cygwin, mainly OS modules
like WIN32. Straight Perl modules should just work out of the box,
and CPAN will get all pre-requisites for you too. You'll never want
ppm again!
Sorry to go off on a slight tangent here, but is there any documentation
anywhere that describe which Win32 modules are problematic, as it's most
likely that for Cygwin users the Win32 modules are of particular
interest, no? And installing both Cygwin's Perl and ActiveState's
distribution can offer a less than satisfactory solution as it presents
its own set of problems.
There is an up to date version of libwin32 as well as Win32CORE included
in the perl distributed, it *should* be possible to build some (not all)
of the Win32 modules, though I have not tried to build much of them.
Just try one or another if it is not already included with libwin32.
Gerrit
Yitzchak Scott-Thoennes
2005-06-02 20:03:09 UTC
Permalink
Post by Linda W
FYI -- I discovered the cause of a problem I had in manipulating the
Registry. There is a bug in the Win32 Registry manipulation routines.
Both TieRegistry and the original Registry interface apparently
use an older interface -- something like (?), libcalls ending with "A"
where new ones end with "W". The "A" interface was for 8-bit characters.
The "W" interface works with the 16-bit characters in the registry.
While it was thought this might have been due to "bogus" registry entries,
according to the MS registry documentation, the only illegal character
in a registry "name" is "\". This causes perl to fail when manipulating
some binary key- & value- names.
I don't know which other routines still use the older 8-bit character
calls, but there may be similar problems if they use the older
interface. Note that these modules are broken in the ASPN version
of perl as well.
I'm not sure if you are the same Linda who posted here:

http://perlmonks.org/index.pl?node_id=456194

but if so, please reread the messages in that thread from Tye, the
maintainer of those modules (other than the obsolete Win32::Registry).

In particular:
This is not a bug, and the modules are not broken. It is an
intentional limitation of the win32 *A routines, which
Win32::TieRegistry uses. It did sound as if he would be open to
patches to *optionally* use *W there. Doing so by default would
break things for existing users.

If you need to use the *W api, it is available through
Win32API::Registry, but you need to take care to provide the UCS-16
encoding that *W expects.

Jason Pearce
2005-05-26 07:37:33 UTC
Permalink
The manual install method is *USUALLY*

Decompressing and unpacking is best done in a temporary directory
somewhere, can usually be done with
cd /tmp
tar xzvf yourmodule.tar.gz
perl Makefile.PL
perl Makefile.PL PREFIX=/my/perl_directory
Then build, test and install the module
make
make test
make install
This is usually covered in the README of the package you down load. And
I say *USUALLY* because there are a handful of packages that don't
follow this install convention and do their own thing, again check for a
README.

Regards,
Jason
Thanks to you and the other people for the answer.
Unfortunatly I don't have Internet-like programs
installed (as lynx, wget, ncftpget, ncftp, etc) in my
cygwing, so I can't use the -MCPAN or just de command
cpan. I don't intend to install those programs to
avoid my cygwin get bigger.
I can download the modules from CPAN using the
Internet program from Windows and save them in the
hard disk.
Can I install the modules manually?
If yes, How, and what must I have in consideration?
Post by Jason Pearce
Yes, use the CPAN module as Brian suggests. Just
make sure environment
variable PERLIO is unset when using -MCPAN,
otherwise it will fail. (You
might set this to CRLF for DOS compatibility
purposes).
Also be aware that you may have trouble building
some modules that use C
code and have not been ported to Cygwin, mainly OS
modules like WIN32.
Straight Perl modules should just work out of the
box, and CPAN will get
all pre-requisites for you too. You'll never want
ppm again!
Regards,
Jason
Post by Brian Dessent
Post by Manuel Tejada
Somebody can tell me from what URL I must to
download
Post by Brian Dessent
Post by Manuel Tejada
a perl module and how to install it in Cygwing?
You use CPAN. "perl -MCPAN -e 'install Foo::Bar'"
or "perl -MCPAN -e
Post by Brian Dessent
shell". There is no URL to know, it takes care of
all of that.
Post by Brian Dessent
http://cpan.org/misc/cpan-faq.html
Post by Manuel Tejada
In pure Windows is easy is you have Perl from
ActiveState but Perl installed in Cygwin doesnt
have
Post by Brian Dessent
Post by Manuel Tejada
the ppm Manager.
To me (and perhaps others) that's a feature and not
a bug. I can't
Post by Brian Dessent
stand that ppm junk.
Brian
--
http://cygwin.com/ml/#unsubscribe-simple
http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
Manuel TEJADA M.
_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
Gerrit P. Haase
2005-05-26 08:31:40 UTC
Permalink
Thanks to you and the other people for the answer.
Unfortunatly I don't have Internet-like programs
installed (as lynx, wget, ncftpget, ncftp, etc) in my
cygwing, so I can't use the -MCPAN or just de command
cpan. I don't intend to install those programs to
avoid my cygwin get bigger.
Come on, a program like wget is so important, how do you download
stuff? Internet Explorer? Isn't this bloat (50 MB)? The whole
wget package is about 1 MB!
I can download the modules from CPAN using the
Internet program from Windows and save them in the
hard disk.
Bloatware...
Can I install the modules manually?
Yes, of course, however, CPAN is much more reliable. You don't
need all the internet tools anyway, Net::Ftp is already included
in the Cygwin Perl release, so there should be no other tools
needed. Just install some more perl modules to make it more
comfortable for you (in the CPAN shell type: `install LWP' to
install the libwww module and dependencies).
If yes, How, and what must I have in consideration?
make, binutils and gcc-core (besides the Cygwin base packages):

$ tar xzf Perl-Mudule-1.2.3
$ cd Perl-Mudule-1.2.3/
$ perl Makefile.PL
$ make
$ make test
$ make UNINST=1 install

Should be listed in the README:
$ cat /usr/share/doc/Cygwin/perl-5.8.6

[...snip...]

Requirements

[...snip...]

CPAN Dependencies:
When building modules you will need Cygwin packages like make,
gcc, binutils, ..., (and additional libraries, depending on the
modules you want to install).

[...snip...]


Gerrit
--
=^..^=
Continue reading on narkive:
Loading...