Should I put the main modules in the PREREQ_PM section of the Makefile.PL file?

Should I put only non-core modules in the PREREQ_PM section of the Makefile.PL file, or should I also place the main modules there?

+7
perl perl-module makefile prerequisites
source share
2 answers

Yes, you must specify all the dependencies: the Perl core has not been fixed for all eternity. Kernel modules are added or removed (after the deprecation process) all the time. Listing all dependencies ...

  • ... will make your program work in the future by removing the module from Core. It will still be available from CPAN. For example, Term::UI is a Core module from version v.5.9.5, but was removed in v5.19.0.

  • ... will claim that a fairly high version of the core module is installed. Some modules have improved significantly over time, and it's easy to forget that not everything was available five years ago.

  • ... will make your program work with older pearls that did not include the module in Core, but can use it nonetheless.

On the other hand, these can be very small gains. Nothing will break if you forget to specify a central module such as Carp as a dependency.

Remember: there are three reasons for enabling a module in Core:

  • Perl related stuff, like strict , which will not be removed.
  • material required to download and install CPAN modules. This includes file system processing. Here changes occur sometimes.
  • Historical breakthrough. Playa throws out CGI.pm; -)

Tip. Use the corelist tool from Module::Corelist to find out which versions of modules are available in the perl release.

+14
source share

There was an interesting discussion on PerlMonks not so long ago.

My personal policy is not to do this.

Although modules are sometimes removed from the kernel, there is a long (about 2 years) aging cycle, which gives you a lot of time to repackage your distribution with updated dependencies.

And if the worst comes to the worst, and you do not update your distribution when they try to install it, they will receive an error message with the missing module, so it should be obvious enough for them how to proceed. (That is, they should install this module, and then try installing yours again.)

+2
source share

All Articles