How do I install a Perl module that's on Sourceforge and not CPAN using ActiveState? - perl

Trying to install Ptkdb on Windows 7 with Perl 5.12.2 (ActiveState) — how do I do this?

ptkdb is available on CPAN. It's also available for Perl 5.12 in the bribes repository:
ppm install http://www.bribes.org/perl/ppm/Devel-ptkdb.ppd

For pure Perl modules, all you need to do is run the Makefile.PL that comes with the module. If the module is a mix of Perl and C, you will need to get a C/C++ compiler for Windows that works with your distribution of Perl. I would recommend asking around for a Windows binary first if it's a mixed module.

Related

How can I install Perl on Windows 8?

I want to use Perl for web development. I have tried to find out how to install it but when I tried to get ActivePerl it wouldn't install on Windows 8. Can anyone tell me how to install Perl on Windows 8? I can go for ActivePerl, Strawberry Perl, or any other Perl release as long as it will work on Windows 8.
As you already know, there are two generally used Perls in the Windows World:
ActivePerl from ActiveState.
Strawberry Perl which is an open source project started by Adam Kennedy -- a big honcho in the Perl community.
What's the big difference between them:
ActiveState Perl was designed to be a Perl solution specifically for Windows (and later both Macs and Linux). ActiveState offers a very nice Perl IDE called Komodo and has excellent Perl support. All you need is some cash. After all, that's how ActiveState makes its money. Of course, you can use EPIC instead of Komodo and get a lot of help from StackOverflow too.
ActiveState comes with the default Win32 modules already installed and also supplies a Perl Package Manager (PPM) instead of using CPAN for installing other CPAN modules. PPM has a nice GUI interface, and its modules have already been precompiled and tested. It also is a bit better than CPAN with dependency tracking. Of course, there might be some CPAN modules not in PPM, and that can be an issue.
Strawberry Perl was started to be more Open Source oriented than ActiveState. By default, Strawberry Perl comes with a Make program and a complete development environment, so that almost all CPAN modules are available and can be installed. This is because Strawberry Perl comes with the complete MinGW package which includes Make and a gcc compiler. The idea was to give Perl people who mainly use Linux and Unix machines a similar feeling solution for Windows.
In reality, both are pretty similar. ActiveState comes with the Win32 modules, but you can install them as needed on Strawberry Perl via CPAN. Strawberry Perl works with CPAN, but ActiveState gives you complete directions for installing the same MinGW environment that Strawberry Perl uses (via their PPM) which allows you to install all CPAN modules that Strawberry Perl can install. ActiveState comes with a GUI Perl Documentation that includes all installed Perl modules, but the perldoc command gives you the same information anyway.
So, if you're more Linux/Unix oriented and want something that feels very similar on Windows, go with Strawberry Perl. If you are using Perl as a Win32 solution, go with ActiveState. And, don't worry about choosing the wrong one. In the end, Strawberry Perl can include all those nice Win32 modules, and ActivePerl can use CPAN.
There is another SO posting that you might find what you're looking for here. A similar posting. In sum, I get the impression that Strawberry Perl would work alright, and so would ActivePerl. I rather liked Strawberry Perl, and it was so long ago that I installed it on my wife's Windows Vista machine that I can't remember why I chose it over ActivePerl, ymmv. CHEERS!

How do I install Perl libraries in Cygwin?

I'm a C/C++/Java/Unix geek by trade, but now I have to write a Perl program in Windows. So I've got Cygwin, Eclipse with EPIC installed, and simple test programs run. I do not have a Unix machine available to me that I can run Eclipse on.
But I need to use Net::TCP::Server and I can't figure out how to install it. It doesn't appear to be part of the Cygwin Perl install, and I don't want to spend 5 days learning the world of Perl and CPAN and Perl configuration. I just want to write my program.
Any simple ways of installing a Perl module in Cygwin? I'm thinking something like apt-get install would be nice, but I expect that's too much to hope for.
Thanks
$ perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.
cpan[1]> install Net::TCP::Server
And it's instructive to list the configuration with the o conf command.
Seeing that some of the info here is a bit outdated and too complicated, I'd rather suggest the following. There are a few different Perl package managers in use. They are all installed with cpan (which is already part of the Cygwin Perl installation), like this:
# Install ppm (outdated)
cpan PPM
# Install cpanp (still used)
cpan CPANPLUS
# Install cpanm (most recent)
cpan App::cpanminus
Then you can install any Perl package you like, as for example in the OP, using cpanm:
cpanm Net::TCP::Server
Sometimes (as noted above) Cygwin may fail certain tests. For example, when using IPv6 on a machine only configured with IPv4, or when your windows firewall is blocking some tests, etc. To attempt to install anyway, try to use the force flag; -f.
cpanm -f Net::TCP::Server
I'm a C/C++/java unix geek by trade, but now I have to write a perl program in windows. So I've got cygwin, eclipse with EPIC installed, and simple test programs run. I do not have a unix machine available to me that I can run eclipse on.
You should be able to run Eclipse with EPIC right under Windows without Cygwin. I like Cygwin for many things, but it isn't exactly a very stable platform. Eclipse runs as a Java program, so all you have to do is make sure Java is installed on your PC. There is even a pre-built Eclipse package.
You can also get a decent Perl that runs right under Windows. Either ActivePerl or Strawberry Perl. Either one will work although many Unix heads prefer Strawberry Perl because it comes with the same MIGW environment that Cygwin has and many feel it's more compatible with the Unix Perl brethren. However, ActiveState Perl can use the Perl Package Manager (PPM) that contains pre-built modules. Unfortunately, the module you want isn't available via PPM.
But I need to use Net::TCP::Server and I can't figure out how to install it. It doesn't appear to be part of the cygwin perl install, and I don't want to spend 5 days learning the world of perl and cpan and perl configuration. I just want to write my program.
Installing from CPAN is really quite simple. The first time you run CPAN, it should pretty much configure itself. Then, to do an install, you run cpan install Net::TCP::Server and that should be it. However, I've tried on several Mac, Unix, and Linux machines, and I can't get it to work. So, this isn't a Windows problem as much as a problem with this module. It is fairly old, and might not work well in newer versions of Perl. You might have to force the install over test's objections.
Maybe you can use one of the already installed IO modules that come with Perl instead. That'll save you a boatload of trouble because the required modules are part of Perl's existing package.
Despite Cygwin's "problems," I use it regularly whenever I have to use Windows. I would recommend first installing a separate installation of Perl using perlbrew so that you won't interfere with Cygwin's copy of Perl in case something bad happens since Cygwin does not enforce root-user policy. In cygwin shell, type
\curl -L http://install.perlbrew.pl | bash
This should walk through the installation for perlbrew and set it up in one of your executable path. Next type
perlbrew init
perlbrew install --force stable
perlbrew switch stable
Wait a bit while a mint Perl is compiled. For unknown reason, Perl can only pass 99.23% of the core module tests on Cygwin (at least on my machine),hence the --force flag). My experience is that it mostly have something to do with handling of device files, like ports and pipes. I am unaware of people trying to resolve the issue as it seems like a Cygwin problem. Although it has not presented much problem for me with general system and web programming tasks. The module testing routines will fail if any problem exists so I am not fretting over it.
Next step is to install cpanm (cpanminus), type
perlbrew install-cpanm
From here on out, to install any library from CPAN, just type
cpanm [library::name1] [library::name2]
cpanm makes it trivial to install any Perl modules. You can even install from your local directory instead of CPAN.
Your mileage may vary, but I had a lot of trouble until I realized that Strawberry perl had a lot of bin folders in my PATH, and when I changed my .bashrc to export only a very simple PATH=/bin:/usr/bin:/usr/local/bin, Cygwin's perl installation's cpan started working beautifully. I used local:lib as Cygwin doesn't support sudo. Before it got into a bad loop saying "Press SPACE and ENTER to exit Patch" over and over.

Trying to install YAML::Syck - This module requires a C compiler

I'm trying to install the YAML::Syck module (I'm actually trying to install Date::Manip, this is just a dependency), but it fails with the following message:
This module requires a C compiler at Makefile.PL line 38.
This happens whether I try to install using CPAN or if I try to download the packages and install manually.
I have gcc installed and on my PATH, I can access it from the same CYGWIN shell window that I'm trying to use to install YAML::Syck.
When looking for a C compiler, ExtUtils::MakeMaker and Module::Build don't necessarily look for gcc in your PATH, but query your perl's configuration for the C compiler it has been built with and expects it to be available for building Perl extensions as well.
On my system, it will look for cc in PATH, as per
$ perl -MConfig -E'say $Config{cc}'
cc
I've had trouble in the past getting everything to "just work" with cygwin, when it comes to compiling modules. You might want to take a look at Strawberry Perl, which is a Windows Perl distribution that comes bundled with all of the components needed for compilation of XS modules. I haven't personally tried to install YAML::Syck with it, but I have installed many other XS modules without incident.
Once it is installed and in your path (usually automatically), you should be able to run cpan from the Windows command prompt to install the module.
Maintainer speaking
The better forum to ask is the cygwin mailinglist. There you will find the same questions being asked again and again, we can point to the messages, and the
maintainers are present.
The quality of the answers will be much better.
The official latest perl announcement was http://sourceware.org/ml/cygwin-announce/2012-07/msg00011.html
perl used to bundle most useful modules for CPAN and Testing with the core perl.
With the latest 5.14 package the useful modules were moved to the seperate package perl_vendor.
The dependencies to be able to compile modules by your own via cpan are not included.
You'll need make and gcc-4 at least.
See /usr/share/doc/Cygwin/perl.README for the package specific README.
YAML::Syck is considered broken and unmaintained (*_why* left), please try to use a better YAML package, like YAML or YAML::XS, written by the inventor and author of YAML itself (ingy).
Date::Manip does not require YAML::Syck. cpan does like to have a YAML modules, but prefers YAML::XS.
You'll find out that you'll be able to install much more packages with cygwin perl than with strawberry perl (=mingw).

Windows equivalent of perl modules required (not available in activestate ppm) such as file::finder

I'm attempting to import code written in linux into eclipse's perl plugin 'epic', and have installed activestate perl in windows. Most of the modules have an activestate equivalent, but some of them I can't find in ppm. Does anyone know how I can get the following modules so that the code can compile?
File::Finder
Spreadsheet::WriteExcel::Utility
Sybase::CTlib
Sybase::DBlib
Sybase::Xfer
Template
Template::Constants
DBD::Sybase
File::Rsync
PerlIO/gzip
The best option is probably to remove Active Perl and replace it with Strawberry Perl. Because the Strawberry Perl installation includes a compiler, you are able to install most CPAN modules using the standard CPAN shell.
Trouchelle to the rescue!
http://trouchelle.com/perl/ppmrepview.pl?l=Template-Toolkit&v=10
The other modules cannot be built because of test failures or missing libraries.
i downloaded the File:finder module from cpan and was able to install successfully in the windows.
Only difference is we need to use nmake instead of make.
You can download perl modules from https://metacpan.org/ and then compile the same in windows.

How can I install or upgrade a CPAN module that is in the latest Perl, without installing the new Perl?

I'd like to install a Perl module (in this case, FindBin), but since it is included in the Perl 5.10.1 distribution, cpan wants to install Perl 5.10 for me. Is there a way of installing just the module via cpan?
The only option that I can see is installing directly from source, which seems a bit crude as there is no separate package (for example, Makefile.PL, etc.), just the bare .pm file.
Since this is a small module that only has the one file, it's doable in this case, but what if I wanted to install a much larger package?
EDIT: This is somewhat aside from the original question, but speaks to the general issue of modules being packaged up with Perl distributions: I discovered that the "standalone" FindBin (version 1.49) had a syntactic error, so I retrieved version 1.50 out of the Perl 5.10.1 distribution... However since the module is now listed on CPAN as part of Perl 5.10, I am unable to find the CHANGES file describing what was changed/fixed in this delta. Is it reasonable that I should have to go into the developer repository to pull out this information?)
EDIT 2. Okay, here's a better example. On Perl 5.8.8 I have version 1.04 of Carp. However, I see that Perl 5.10.1 comes packaged with version 1.11. Is there a way of getting CPAN to install the latest version of Carp for me without dragging in all of Perl 5.10.1? I can't even find a link to the Carp module on CPAN except to the perl 5.10.1 installation.
> corelist FindBin
FindBin was first released with perl 5.00307
Which version of Perl do you use that does not include FindBin? If you use at least Perl 5.6.0 (all versions before are considered deprecated), you have no need to install FindBin. If you have anything older, I suggest an upgrade to 5.6.2/5.8.9/5.10.1.
Kurila is not a "standalone" FindBin, it's a dialect of Perl. FindBin is not a dual life and is released only bundled with Perl. You can consider releasing FindBin to CPAN as standalone distribution - it is easy if you used ExtUtils::MakeMaker in past.
Latest useful change of FindBin was on 2007-04-28, related to VMS. Latest useful non-VMS change was on 2006-10-25.
Things you can try include
Dropping FindBin.pm into the same directory as your executable and using use FindBin
Dropping FindBin.pm into your Perl library directory
Using the source code of the module in your script