NAME
Type::Params::Parameter - internal representation of a parameter in a function signature
STATUS
This module is not covered by the Type-Tiny stability policy.
DESCRIPTION
This is mostly internal code, but can be used to provide basic introspection for signatures.
Constructor
Attributes
All attributes are read-only.
typeTypeTiny-
Type constraint for the parameter.
defaultCodeRef|ScalarRef|Ref|Str|Undef-
A default for the parameter: either a coderef to generate a value, a reference to a string of Perl code to generate the value, an a reference to an empty array or empty hash, a literal string to use as a default, or a literal undef to use as a default.
strictnessBool|ScalarRef-
A boolean indicating whether to be stricter with type checks, or a reference to a string of Perl code naming a Perl variable or constant which controls strict behaviour.
cloneBool-
The method for accessing this is called
should_clonefor no particular reason. coerceBool-
Defaults to true if
typehas a coercion. optionalBool-
Defaults to true if there is a
defaultor iftypeis a subtype of Optional. in_listBool-
Boolean that is only used when the signature has the
list_to_namedfeature enabled. default_on_undefBool-
Should the default be triggered if the caller passes an explicit undef?
Attributes related to named parameters
Methods
Predicates
Predicate methods return true/false to indicate the presence or absence of attributes.
has_typehas_defaulthas_strictnesshas_namehas_alias
Other methods
might_supply_new_value-
Indicates that the parameter can't simply be referenced within
@_because a default value might be used, the given value might be coerced, or the given value might be cloned using Storable.
BUGS
Please report any bugs to https://github.com/tobyink/p5-type-tiny/issues.
SEE ALSO
Type::Params, Type::Params::Signature.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2023-2025 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.