Adam Kennedy wrote:

While the code for the distribution might be able to die like this, the INSTALLER should fail in a way that is detectable and automatable.

If the C<use>d warnings.pm module can't be found, it crashes (specifically, dies) and say it can't find warnings. But the problem isn't that it doesn't have warnings. The problem is that it doesn't have Perl 5.006.

If the installer needs a module in order to run, it has nothing to fall back on to supply that module for it. Any surrounding client doing a recursive installation can't fix it, unless what it can do when the installer runs and says that the distribution itself needs dependencies.

To be honest, I don't understand why you're all having such discussions about using or not modules. The advantage of Perl is that it's a dynamic language, where you can use eval() to dynamically load a module and an avoid horrible death which can let end users in awe.

For example, I have an eval 'use ExtUtils::MakeMaker::Coverage' in most of my Makefile.PL in order to have the textcover target where all required modules are installed. Granted, this won't work for lexical pragmas like "warnings", but to be honest, I don't see the value of showing useless warnings to the end user.

If an installer can't INSTALL under battle conditions, it is failing it's primary missing.

General rule of thumb: check with Module::CoreList which modules are in the core, and since when, then decide which Perl version you want to target, and eval-use all the modules that are not in the core of this version. Also apply to platform-specific modules (like Win32::*). Simple and works well; you can write Makefile.PL that work with old Perl versions.

This is a little harder with Module::Build as it has a few dependencies that ask 5.005 or 5.6, although in some cases incorrectly. I send patches so modules like File::Temp or ExtUtils::Constant work with 5.004 (and maybe earlier) but their author haven't yet released updated versions. With these patches (and if the test suites of some of these are fixed), several modules can probably work on 5.004 or earlier with little to no changes.


Sébastien Aperghis-Tramoni
 -- - --- -- - -- - --- -- - --- -- - --[ http://maddingue.org ]
Close the world, txEn eht nepO

Reply via email to