Task::Weaken(3)
πΈ NAME πΈ
Okay bestie, welcome to the Task::Weaken(3) page from the User Contributed Perl Documentation. This module is literally here to ensure that a platform has weaken support π
, and it's giving βsmall dependency, major save.β π«Ά
β¨ VERSION β¨
Version 1.06, periodt. π
π¦ DESCRIPTION π¦
Okay so here's the recurring problem: modules that use Scalar::Util's weaken function can get absolutely got because weaken is not present in the pure-perl variant. π
And while that isn't necessarily 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 β even though a dependency on Scalar::Util passed successfully. Like, the dependency check said yes and the platform still said βbestie no.β π
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. Iconic behavior, no cap. π
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. Like, the vibe check failed and the module got included anyway π
To get around that for this module, it will do a few dirty tricks. π
- If
Scalar::Utilis not available at all, it will issue a normal dependency on the module. - However, if
Scalar::Utilis 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). Slay that dependency in one line:
requires 'Task::Weaken' => 0;
π SUPPORT π
Bugs should 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 π¦
Adam Kennedy β <adamk@cpan.org> π
π SEE ALSO π
Task, Scalar::Util, <http://ali.as/> β go look, iykyk. β
π COPYRIGHT π
Copyright 2006 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
That's the tea from the User Contributed Perl Documentation β perl v5.42.0, dated 2019-01-28, signing off π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Task-Weaken 1.06-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms