8
votes

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.

2
Out of curiosity, is there a burning reason not to install 5.10? - Chris Lutz
Yes, because my company is still afraid of it (i.e. we haven't done enough testing on it to be sure it won't break our code). :) - Ether
PS. Carp is now at v1.18 in the perl5.13.* line, and fixes many longstanding issues.. but those benefits are not seen by those on earlier Perl versions. - Ether

2 Answers

3
votes
> 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.

1
votes

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