1Task::Weaken(3) User Contributed Perl Documentation Task::Weaken(3)
2
3
4
6 Task::Weaken - Ensure that a platform has weaken support
7
9 version 1.06
10
12 One recurring problem in modules that use Scalar::Util's "weaken"
13 function is that it is not present in the pure-perl variant.
14
15 While this isn't necessarily always a problem in a straight CPAN-based
16 Perl environment, some operating system distributions only include the
17 pure-Perl versions, don't include the XS version, and so weaken is then
18 "missing" from the platform, despite passing a dependency on
19 Scalar::Util successfully.
20
21 Most notably this is RedHat Linux at time of writing, but other come
22 and go and do the same thing, hence "recurring problem".
23
24 The normal solution is to manually write tests in each distribution to
25 ensure that "weaken" is available.
26
27 This restores the functionality testing to a dependency you do once in
28 your Makefile.PL, rather than something you have to write extra tests
29 for each time you write a module.
30
31 It should also help make the package auto-generators for the various
32 operating systems play more nicely, because it introduces a dependency
33 that they have to have a proper weaken in order to work.
34
35 How this Task works
36 Part of the problem seems to stem from the fact that some distributions
37 continue to include modules even if they fail some of their tests.
38
39 To get around that for this module, it will do a few dirty tricks.
40
41 If Scalar::Util is not available at all, it will issue a normal
42 dependency on the module. However, if Scalar::Util is relatively new (
43 it is >= 1.19 ) and the module does not have weaken, the install will
44 bail out altogether with a long error encouraging the user to seek
45 support from their vendor (this problem happens most often in vendor-
46 packaged Perl versions).
47
48 This distribution also contains tests to ensure that weaken is
49 available using more normal methods.
50
51 So if your module uses "weaken", you can just add the following to your
52 Module::Install-based Makefile.PL (or equivalent).
53
54 requires 'Task::Weaken' => 0;
55
57 Bugs should be always be reported via the CPAN bug tracker at
58
59 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Task-Weaken>
60
61 For other issues,contact the author.
62
64 Adam Kennedy <adamk@cpan.org>
65
67 Task, Scalar::Util, <http://ali.as/>
68
70 Copyright 2006 - 2011 Adam Kennedy.
71
72 This program is free software; you can redistribute it and/or modify it
73 under the same terms as Perl itself.
74
75 The full text of the license can be found in the LICENSE file included
76 with this module.
77
78
79
80perl v5.32.0 2020-07-28 Task::Weaken(3)