{
    "mode": "perldoc",
    "parameter": "Specio::Subs",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Specio%3A%3ASubs/json",
    "generated": "2026-06-15T14:20:05Z",
    "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);",
    "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": []
        }
    },
    "summary": "Specio::Subs - Make validation and coercion subs from Specio types",
    "flags": [],
    "examples": [],
    "see_also": []
}