{
    "content": [
        {
            "type": "text",
            "text": "# Specio::Subs (perldoc)\n\n## NAME\n\nSpecio::Subs - Make validation and coercion subs from Specio types\n\n## SYNOPSIS\n\nuse Specio::Subs qw( Specio::Library::Builtins Specio::Library::Perl My::Lib );\nif ( isPackageName($var) ) { ... }\nassertStr($var);\nmy $person1 = toPerson($var);\nmy $person2 = forcePerson($var);\n\n## DESCRIPTION\n\nThis module generates a set of helpful validation and coercion subroutines for all of the types\ndefined in one or more libraries.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ADDITIONAL API**\n- **SUPPORT**\n- **SOURCE**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Specio::Subs",
        "section": "",
        "mode": "perldoc",
        "summary": "Specio::Subs - Make validation and coercion subs from Specio types",
        "synopsis": "use Specio::Subs qw( Specio::Library::Builtins Specio::Library::Perl My::Lib );\nif ( isPackageName($var) ) { ... }\nassertStr($var);\nmy $person1 = toPerson($var);\nmy $person2 = forcePerson($var);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 32,
                "subsections": []
            },
            {
                "name": "ADDITIONAL API",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Specio::Subs - Make validation and coercion subs from Specio types\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 0.47\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Specio::Subs qw( Specio::Library::Builtins Specio::Library::Perl My::Lib );\n\nif ( isPackageName($var) ) { ... }\n\nassertStr($var);\n\nmy $person1 = toPerson($var);\nmy $person2 = forcePerson($var);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module generates a set of helpful validation and coercion subroutines for all of the types\ndefined in one or more libraries.\n\nTo use it, simply import \"Specio::Subs\" passing a list of one or more library names. This module\nwill load those libraries as needed.\n\nIf any of the types in any libraries have names that do not work as part of a Perl subroutine\nname, this module will throw an exception.\n\nIf you have Sub::Util or Sub::Name installed, one of those will be used to name the generated\nsubroutines.\n\n\"EXPORTS\"\nThe following subs are created in the importing package:\n\nis$type($value)\nThis subroutine returns a boolean indicating whether or not the $value is valid for the type.\n\nassert$type($value)\nThis subroutine dies if the $value is not valid for the type.\n\nto$type($value)\nThis subroutine attempts to coerce $value into the given type. If it cannot be coerced it\nreturns the original $value.\n\nThis is only created if the type has coercions.\n\nforce$type($value)\nThis subroutine attempts to coerce $value into the given type, and dies if it cannot do so.\n\nThis is only created if the type has coercions.\n",
                "subsections": []
            },
            "ADDITIONAL API": {
                "content": "This module has a subroutine named \"subsinstalledinto\". It is not exported but it can be\ncalled by its fully qualified name. It accepts a single argument, a package name. It returns a\nlist of subs that it generated and installed in the given package, if any.\n\nThis exists to make it easy to write a type library that combines other library and generates\nhelper subs for export all at once.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "Bugs may be submitted at <https://github.com/houseabsolute/Specio/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "The source code repository for Specio can be found at <https://github.com/houseabsolute/Specio>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Dave Rolsky <autarch@urth.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2012 - 2021 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included with this distribution.\n",
                "subsections": []
            }
        }
    }
}