.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Task::Weaken 3" .TH Task::Weaken 3 2025-12-14 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Task::Weaken \- Ensure that a platform has weaken support .SH VERSION .IX Header "VERSION" version 1.06 .SH DESCRIPTION .IX Header "DESCRIPTION" One recurring problem in modules that use Scalar::Util\*(Aqs \f(CW\*(C`weaken\*(C'\fR function is that it is not present in the pure\-perl variant. .PP While this isn\*(Aqt necessarily always a problem in a straight CPAN\-based Perl environment, some operating system distributions only include the pure\-Perl versions, don\*(Aqt include the XS version, and so weaken is then "missing" from the platform, \fBdespite\fR passing a dependency on Scalar::Util successfully. .PP Most notably this is RedHat Linux at time of writing, but other come and go and do the same thing, hence "recurring problem". .PP The normal solution is to manually write tests in each distribution to ensure that \f(CW\*(C`weaken\*(C'\fR is available. .PP This restores the functionality testing to a dependency you do once in your \fIMakefile.PL\fR, rather than something you have to write extra tests for each time you write a module. .PP It should also help make the package auto\-generators for the various operating systems play more nicely, because it introduces a dependency that they \fBhave\fR to have a proper weaken in order to work. .SS "How this Task works" .IX Subsection "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. .PP To get around that for this module, it will do a few dirty tricks. .PP 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 \fBnot\fR 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). .PP This distribution also contains tests to ensure that weaken is available using more normal methods. .PP So if your module uses \f(CW\*(C`weaken\*(C'\fR, you can just add the following to your Module::Install\-based \fIMakefile.PL\fR (or equivalent). .PP .Vb 1 \& requires \*(AqTask::Weaken\*(Aq => 0; .Ve .SH SUPPORT .IX Header "SUPPORT" Bugs should be always be reported via the CPAN bug tracker at .PP .PP For other issues,contact the author. .SH AUTHOR .IX Header "AUTHOR" Adam Kennedy .SH "SEE ALSO" .IX Header "SEE ALSO" Task, Scalar::Util, .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2006 \- 2011 Adam Kennedy. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the LICENSE file included with this module.