Specio::Library::Builtins - Implements type constraint objects for Perl's built-in types
version 0.31
This library provides a set of types parallel to those provided by Moose.
The types are in the following hierarchy
Item Bool Maybe (of `a) Undef Defined Value Str Num Int ClassName Ref ScalarRef (of `a) ArrayRef (of `a) HashRef (of `a) CodeRef RegexpRef GlobRef FileHandle Object
Accepts any value
Accepts a non-reference that is undef, an empty string, 0, or 1. It also accepts any object which overloads boolification.
undef
0
1
A parameterizable type which accepts undef or the type `a. If not parameterized this type will accept any value.
`a
Only accepts undef.
Accepts any non-reference value.
Accepts any non-reference value or an object which overloads stringification.
Accepts nearly the same values as Scalar::Util::looks_like_number, but does not accept numbers with leading or trailing spaces, infinities, or NaN. Also accepts an object which overloads numification.
Scalar::Util::looks_like_number
Accepts any integer value, or an object which overloads numification and numifies to an integer.
Accepts any value which passes Str where the string is a loaded package.
Str
Accepts any reference.
Accepts a scalar reference or an object which overloads scalar dereferencing. If parameterized, the dereferenced value must be of type `a.
Accepts a array reference or an object which overloads array dereferencing. If parameterized, the values in the arrayref must be of type `a.
Accepts a hash reference or an object which overloads hash dereferencing. If parameterized, the values in the hashref must be of type `a.
Accepts a code (sub) reference or an object which overloads code dereferencing.
Accepts a regex object created by qr// or an object which overloads regex interpolation.
qr//
Accepts a glob reference or an object which overloads glob dereferencing.
Accepts a glob reference which is an open file handle, any IO::Handle Object or subclass, or an object which overloads glob dereferencing and returns a glob reference which is an open file handle.
IO::Handle
Accepts any blessed object.
Bugs may be submitted through https://github.com/houseabsolute/Specio/issues.
I am also usually active on IRC as 'drolsky' on irc://irc.perl.org.
irc://irc.perl.org
Dave Rolsky <autarch@urth.org>
This software is Copyright (c) 2016 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Specio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Specio
CPAN shell
perl -MCPAN -e shell install Specio
For more information on module installation, please visit the detailed CPAN module installation guide.