Type::Params::Parameter(3pm)

Type::Params::Parameter3pm

Internal representation of a parameter in a function signature

Status

This module is not covered by the Type-Tiny stability policy.

Overview

This is mostly internal code, but can be used to provide basic introspection for signatures.

Constructor

new(%attributes)

Attributes

All attributes are read-only.

"type" TypeTiny

Type constraint for the parameter.

"default" CodeRef|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.

"strictness" Bool|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.

"clone" Bool

The method for accessing this is called "should_clone" for no particular reason.

"coerce" Bool

Defaults to true if "type" has a coercion.

"optional" Bool

Defaults to true if there is a "default" or if "type" is a subtype of Optional.

"in_list" Bool

Boolean that is only used when the signature has the "list_to_named" feature enabled.

"default_on_undef" Bool

Should the default be triggered if the caller passes an explicit undef?

Attributes related to named parameters

"name" Str
"alias" ArrayRef[Str]
"getter" Str
"predicate" Str

Methods

Predicates

Predicate methods return true/false to indicate the presence or absence of attributes.

"has_type"
"has_default"
"has_strictness"
"has_name"
"has_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.

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.

Bugs

Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>.

Author

Toby Inkster <[email protected]>.

From perl-type-tiny 2.010001-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.