{
    "mode": "perldoc",
    "parameter": "Task::Weaken",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Task%3A%3AWeaken/json",
    "generated": "2026-06-12T15:23:52Z",
    "sections": {
        "NAME": {
            "content": "Task::Weaken - Ensure that a platform has weaken support\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 1.06\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "One recurring problem in modules that use Scalar::Util's \"weaken\" function is that it is not\npresent in the pure-perl variant.\n\nWhile this isn't necessarily always a problem in a straight CPAN-based Perl environment, some\noperating system distributions only include the pure-Perl versions, don't include the XS\nversion, and so weaken is then \"missing\" from the platform, despite passing a dependency on\nScalar::Util successfully.\n\nMost notably this is RedHat Linux at time of writing, but other come and go and do the same\nthing, hence \"recurring problem\".\n\nThe normal solution is to manually write tests in each distribution to ensure that \"weaken\" is\navailable.\n\nThis restores the functionality testing to a dependency you do once in your Makefile.PL, rather\nthan something you have to write extra tests for each time you write a module.\n\nIt should also help make the package auto-generators for the various operating systems play more\nnicely, because it introduces a dependency that they have to have a proper weaken in order to\nwork.\n",
            "subsections": [
                {
                    "name": "How this Task works",
                    "content": "Part of the problem seems to stem from the fact that some distributions continue to include\nmodules even if they fail some of their tests.\n\nTo get around that for this module, it will do a few dirty tricks.\n\nIf Scalar::Util is not available at all, it will issue a normal dependency on the module.\nHowever, if Scalar::Util is relatively new ( it is >= 1.19 ) and the module does not have\nweaken, the install will bail out altogether with a long error encouraging the user to seek\nsupport from their vendor (this problem happens most often in vendor-packaged Perl versions).\n\nThis distribution also contains tests to ensure that weaken is available using more normal\nmethods.\n\nSo if your module uses \"weaken\", you can just add the following to your Module::Install-based\nMakefile.PL (or equivalent).\n\nrequires 'Task::Weaken' => 0;\n"
                }
            ]
        },
        "SUPPORT": {
            "content": "Bugs should be always be reported via the CPAN bug tracker at\n\n<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Task-Weaken>\n\nFor other issues,contact the author.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Adam Kennedy <adamk@cpan.org>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Task, Scalar::Util, <http://ali.as/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2006 - 2011 Adam Kennedy.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nThe full text of the license can be found in the LICENSE file included with this module.\n",
            "subsections": []
        }
    },
    "summary": "Task::Weaken - Ensure that a platform has weaken support",
    "flags": [],
    "examples": [],
    "see_also": []
}