1Task::Weaken(3)       User Contributed Perl Documentation      Task::Weaken(3)
2
3
4

NAME

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

DESCRIPTION

9       One recurring problem in modules that use Scalar::Util's "weaken" func‐
10       tion is that it is not present in the pure-perl variant.
11
12       While this isn't necesarily always a problem in a straight CPAN-based
13       Perl environment, some operating system distributions only include the
14       pure-Perl versions, don't include the XS version, and so weaken is then
15       "missing" from the platform, despite passing a dependency on
16       Scalar::Util successfully.
17
18       Most notably this is RedHat Linux at time of writing, but other come
19       and go and do the same thing, hence "recurring problem".
20
21       The normal solution is to manually write tests in each distribution to
22       ensure that "weaken" is available.
23
24       This restores the functionality testing to a dependency you do once in
25       your Makefile.PL, rather than something you have to write extra tests
26       for each time you write a module.
27
28       It should also help make the package auto-generators for the various
29       operating systems play more nicely, because it introduces a dependency
30       that they have to have a proper weaken in order to work.
31
32       How this Task works
33
34       Part of the problem seems to stem from the fact that some distributions
35       continue to include modules even if they fail some of their tests.
36
37       To get around that for this module, it will do a few dirty tricks.
38
39       If Scalar::Util is not available at all, it will issue a normal depen‐
40       dency on the module. However, if Scalar::Util is relatively new ( it is
41       >= 1.19 ) and the module does not have weaken, the install will bail
42       out altogether with a long error encouraging the user to seek support
43       from their vendor (this problem happens most often in vendor-packaged
44       Perl versions).
45
46       This distribution also contains tests to ensure that weaken is avail‐
47       able using more normal methods.
48
49       So if your module uses "weaken", you can just add the following to your
50       Module::Install-based Makefile.PL (or equivalent).
51
52         requires 'Task::Weaken' => 0;
53

AUTHOR

55       Adam Kennedy <adamk@cpan.org>, <http://ali.as/>
56

SEE ALSO

58       Task, Scalar::Util, <http://ali.as/>
59
61       Copyright 2006 - 2007 Adam Kennedy.
62
63       This program is free software; you can redistribute it and/or modify it
64       under the same terms as Perl itself.
65
66       The full text of the license can be found in the LICENSE file included
67       with this module.
68
69
70
71perl v5.8.8                       2007-11-13                   Task::Weaken(3)
Impressum