{
    "mode": "perldoc",
    "parameter": "HTML::Mason::Tools",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/HTML%3A%3AMason%3A%3ATools/json",
    "generated": "2026-06-13T08:45:46Z",
    "sections": {
        "NAME": {
            "content": "HTML::Mason::Tools - Function library used internally in Mason\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module contains exportable functions that are intended to be used by other Mason modules.\n\nThe documentation here is primarily intended to be used by Mason core developers.\n\nOthers who choose to use these functions do so at their own risk, as they may change from\nrelease to release. You have been warned.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "readfile\nThis function takes a file name and an optional argument indicating whether or not to open\nthe final in binary mode. It will return the entire contents of the file as a scalar.\n\npathseq\nGiven to paths, this function indicates whether they represent the same location on the\nfilesystem. It does not account for symlinks.\n\ncompresspath\nThis turns a component path into a filesystem-friendly path by escaping potentially\nmeaningful characters.\n\nabsolutecomppath\nGiven a component path and a directory path, this function returns the absolute component\npath, prepending the directory path if needed.\n\nmasoncanonpath\nThis function cleans up a component path and returns its canonical version. It is largely\nthe same as File::Spec::Unix::canonpath, with a few additional cleanups.\n\npkginstalled\nGiven a module name, this function returns true or false to indicate whether or not a\ncorresponding .pm file exists.\n\npkgloaded\nGiven a module name, this function returns true or false to indicate whether or not the\nmodule has been loaded into memory.\n\nloadpkg\nGiven a module name, this function attempts to load it. It takes an additional boolean\nparameter indicating whether or not to throw an exception if the module cannot be found. By\ndefault, if the module cannot be found, this function simply returns false.\n\nAll errors generate exceptions no matter what.\n\nIf the module is loaded successfully, this function returns true.\n\ntaintison\nReturns a boolean value indicating whether taint mode is on or not.\n\ncoercetoarray\nGiven a scalar, which may be a reference, this function attempts to return an array. It\nthrows an HTML::Mason::Exception::Params exception if this can't be done.\n\nThis function is called from the generated component code as part of a component's argument\nhandling.\n\ncoercetohash\nGiven a scalar, which may be a reference, this function attempts to return a hash. It throws\nan HTML::Mason::Exception::Params exception if this can't be done.\n\nThis function is called from the generated component code as part of a component's argument\nhandling.\n\nchecksum\nComputes a simple checksum of a string. Used for Compiler::objectid.\n",
            "subsections": []
        }
    },
    "summary": "HTML::Mason::Tools - Function library used internally in Mason",
    "flags": [],
    "examples": [],
    "see_also": []
}