views:

311

answers:

2

I'd like to install a Perl module (in this case, FindBin), but since it is included in the perl5.10.1 distribution, cpan wants to install perl5.10 for me. Is there any 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 (e.g. 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 perl5.10.1 distribution... however since the module is now listed on cpan as part of perl5.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 perl5.8.8 I have version 1.04 of Carp. However, I see that perl5.10.1 comes packaged with version 1.11. Is there any way of getting CPAN to install the latest version of Carp for me without dragging in all of perl5.10.1? I can't even find a link to the Carp module on CPAN except to the perl5.10.1 installation.

+1  A: 

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
Kinopiko
As I said in the question: installing the source into my perl lib directory is doable in this case as it is a small module, but this is far from desirable as a general practice, and not workable at all for a larger distribution.
Ether
Your question doesn't say that.
Kinopiko
+3  A: 
>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.

Alexandr Ciornii
Thanks, I'll give that a try next week. I could have sworn that it wasn't already installed in my distro, but I must have been mistaken.. :)
Ether
You're right, FindBin is sitting there in `/usr/lib/perl5/site_perl/5.8.8/FindBin.pm`, so I don't know what I was smoking before. Accepting answer... but I still wonder: **what about other modules that have been rolled into a later distribution? How can they be installed into earlier versions of perl?**
Ether
Ether: Most of modules that were updated or added in newer perls can be installed from CPAN. For. ex, I help maintain two of them, Text::ParseWords and Win32API::File. You can update them the same way as others.
Alexandr Ciornii
Ok, my worry was that they would only be available on cpan via the perl5.xx distribution, not as a standalone module as well. I'm building a new home system soon, so perhaps I'll find an example at that point, before fretting too much. :) thanks for the assistance!
Ether
@Alexandr: it would seem that Carp is one distribution that is not available separately (5.10.1 has version 1.11; 5.8.8 has 1.04).
Ether