Should I put only non-core modules in the PREREQ_PM section of a Makefile.PL or should I put there the core modules too?
Yes, you should specify all dependencies: The Perl Core is not fixed in all eternity. Core modules get added or removed (after a deprecation process) all the time. Specifying all your dependencies…
… will make your program work in future perls that have removed the module from Core. It will still be available from CPAN. For example Term::UI
is a Core module since v5.9.5 but was removed in v5.19.0.
… will assert that a sufficiently high version of the core module in question is installed. Some modules have evolved significantly through time, and it is easy to forget that not everything was available five years ago.
… will make your program work on older perls that didn't include the module into Core, but are nevertheless able to use it.
On the other hand these can be very small gains. Nothing will break should you forget to specify such a central module like Carp
as a dependency.
Remember: There are three causes for a module to be included in Core:
strict
which is not going to be removed.Tip: use the corelist
tool from Module::Corelist
to see what modules versions are available in which perl release.