{
    "mode": "info",
    "parameter": "Specio::Subs",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/Specio%3A%3ASubs/json",
    "generated": "2026-07-05T13:25:44Z",
    "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\nsubroutines for all of the types defined in one or more libraries.\n\nTo use it, simply import \"Specio::Subs\" passing a list of one or more\nlibrary names. This module will load those libraries as needed.\n\nIf any of the types in any libraries have names that do not work as\npart of a Perl subroutine name, this module will throw an exception.\n\nIf you have Sub::Util or Sub::Name installed, one of those will be used\nto name the generated subroutines.\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\nis 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\ncannot be coerced it returns 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\nif 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\nexported but it can be called by its fully qualified name. It accepts a\nsingle argument, a package name. It returns a list of subs that it\ngenerated and installed in the given package, if any.\n\nThis exists to make it easy to write a type library that combines other\nlibrary and generates helper subs for export all at once.\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted at\n<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\n<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\nwith this distribution.\n\nperl v5.32.0                      2021-01-31                 Specio::Subs(3pm)",
            "subsections": []
        }
    },
    "summary": "Specio::Subs - Make validation and coercion subs from Specio types",
    "flags": [],
    "examples": [],
    "see_also": []
}