{
    "mode": "perldoc",
    "parameter": "Template::Plugin::Scalar",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Template%3A%3APlugin%3A%3AScalar/json",
    "generated": "2026-07-05T15:59:38Z",
    "synopsis": "[% USE scalar %]\n# TT2 calls object methods in array context by default\n[% object.method %]\n# force it to use scalar context\n[% object.scalar.method %]\n# also works with subroutine references\n[% scalar.mysubref %]",
    "sections": {
        "NAME": {
            "content": "Template::Plugin::Scalar - call object methods in scalar context\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "[% USE scalar %]\n\n# TT2 calls object methods in array context by default\n[% object.method %]\n\n# force it to use scalar context\n[% object.scalar.method %]\n\n# also works with subroutine references\n[% scalar.mysubref %]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Template Toolkit calls user-defined subroutines and object methods using Perl's array\ncontext by default. This plugin module provides a way for you to call subroutines and methods in\nscalar context.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Andy Wardley <abw@wardley.org> <http://wardley.org/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (C) 2008 Andy Wardley. All Rights Reserved.\n\nThis module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Template::Plugin\n",
            "subsections": []
        }
    },
    "summary": "Template::Plugin::Scalar - call object methods in scalar context",
    "flags": [],
    "examples": [],
    "see_also": []
}