Task::Weaken - Ensure that a platform has weaken support


Task-Weaken documentation Contained in the Task-Weaken distribution.

Index


Code Index:

NAME

Top

Task::Weaken - Ensure that a platform has weaken support

DESCRIPTION

Top

One recurring problem in modules that use Scalar::Util's weaken function is that it is not present in the pure-perl variant.

While this isn't necesarily always a problem in a straight CPAN-based Perl environment, some operating system distributions only include the pure-Perl versions, don't include the XS version, and so weaken is then "missing" from the platform, despite passing a dependency on Scalar::Util successfully.

Most notably this is RedHat Linux at time of writing, but other come and go and do the same thing, hence "recurring problem".

The normal solution is to manually write tests in each distribution to ensure that weaken is available.

This restores the functionality testing to a dependency you do once in your Makefile.PL, rather than something you have to write extra tests for each time you write a module.

It should also help make the package auto-generators for the various operating systems play more nicely, because it introduces a dependency that they have to have a proper weaken in order to work.

How this Task works

Part of the problem seems to stem from the fact that some distributions continue to include modules even if they fail some of their tests.

To get around that for this module, it will do a few dirty tricks.

If Scalar::Util is not available at all, it will issue a normal dependency on the module. However, if Scalar::Util is relatively new ( it is >= 1.19 ) and the module does not have weaken, the install will bail out altogether with a long error encouraging the user to seek support from their vendor (this problem happens most often in vendor-packaged Perl versions).

This distribution also contains tests to ensure that weaken is available using more normal methods.

So if your module uses weaken, you can just add the following to your Module::Install-based Makefile.PL (or equivalent).

  requires 'Task::Weaken' => 0;

SUPPORT

Top

Bugs should be always be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Task-Weaken

For other issues,contact the author.

AUTHOR

Top

Adam Kennedy <adamk@cpan.org>

SEE ALSO

Top

Task, Scalar::Util, http://ali.as/

COPYRIGHT

Top


Task-Weaken documentation Contained in the Task-Weaken distribution.

package Task::Weaken;

use 5.005;
use strict;

use vars qw{$VERSION};
BEGIN {
	$VERSION = '1.04';
}

1;

__END__