Type::Params::Signature(3) User Contributed Perl Documentation Type::Params::Signature(3)

# [NAME](#NAME)

Type::Params::Signature - internal representation of a function signature

# [STATUS](#STATUS)

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

# [DESCRIPTION](#DESCRIPTION)

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

## [Constructors](#Constructors)

[new(%attributes)](#new%28_attributes%29)

"new\_from\_compile($style, %attributes)"

[new\_from\_v2api(\\%attributes)](#new_from_v2api%28)

## [Attributes](#Attributes)

All attributes are read-only.

"package" **ClassName**

The package we're providing a signature for. Will be used to look up any stringy type names.

"subname" **Str**

The sub we're providing a signature for.

"description" **Str**

"method" **ArrayRef\[InstanceOf\['Type::Params::Parameter']]**

"head" **ArrayRef\[InstanceOf\['Type::Params::Parameter']]**

"tail" **ArrayRef\[InstanceOf\['Type::Params::Parameter']]**

"parameters" **ArrayRef\[InstanceOf\['Type::Params::Parameter']]**

"slurpy" **InstanceOf\['Type::Params::Parameter']**

"on\_die" **CodeRef**

"strictness" **Bool|ScalarRef**

"next" **CodeRef**

"goto\_next" **CodeRef**

Alias for "next".

"can\_shortcut" **Bool**

Indicates whether the signature has no potential to alter @_ allowing it to be returned without being copied if type checks pass. Generally speaking, you should not provide this to the constructor and rely on Type::Params::Signature to figure it out.

"coderef" **InstanceOf\['Eval::TypeTiny::CodeAccumulator']**

You probably don't want to provide this to the constructor. The whole point of this module is to build it for you!

*Attributes related to named parameters*

"is\_named" **Bool**

"allow\_dash" **Bool**

"bless" **Bool|ClassName**

"class" **ClassName**

"constructor" **Str**

"class\_attributes" **HashRef**

HashRef suitable for passing to the "import" method of Class::XSAccessor. A default will be generated based on "parameters"

"named\_to\_list" **ArrayRef**

Can be coerced from a bool based on "parameters".

"list\_to\_named" **Bool**

"oo\_trace" **Bool**

Defaults to true. Indicates whether blessed $arg hashrefs created by the signature will include a '~~caller' key.

*Bare attributes*

These attributes may be passed to the constructors and may do something, but no methods are provided to access the values later.

"positional" or "pos" **ArrayRef**

"named" **ArrayRef**

"multiple" or "multi" **ArrayRef**

"returns" **Bool**

Shortcut for setting "returns\_scalar" and "returns\_list" simultaneously.

"want\_source" **Bool**

"want\_details" **Bool**

"want\_object" **Bool**

"rationalize\_slurpies" **Bool**

## [Methods](#Methods)

*Predicates*

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

"has\_description"

"has\_head"

"has\_tail"

"has\_parameters"

"has\_slurpy"

"has\_on\_die"

"has\_strictness"

"has\_returns\_scalar"

"has\_returns\_list"

*Class making methods*

These methods will be called automatically during object construction and should not typically be called. They are public methods in case it is desired to subclass Type::Params::Signature.

"make\_class\_pp"

Builds the class specified in "bless" by evaluating Perl code.

"make\_class\_xs"

Builds the class specified in "bless" using Class::XSAccessor.

"make\_class"

Calls either "make\_class\_pp" or "make\_class\_xs".

"make\_class\_pp\_code"

Generates the code for "make\_class\_pp".

*Other methods*

"BUILD"

Called by the constructors. You should not call this.

"return\_wanted"

Normally returns the signature coderef, unless "want\_source", "want\_details", or "want\_object" were provided to the constructor, in which case it will return the source code for the coderef, a hashref of details, or $self.

# [ENVIRONMENT](#ENVIRONMENT)

"PERL\_TYPE\_PARAMS\_XS"

Affects the building of accessors for $arg objects. If set to true, will use Class::XSAccessor. If set to false, will use pure Perl. If this environment variable does not exist, will use Class::XSAccessor.

If Class::XSAccessor is not installed or is too old, pure Perl will always be used as a fallback.

# [BUGS](#BUGS)

Please report any bugs to &lt;https://github.com/tobyink/p5-type-tiny/issues&gt;.

# [SEE ALSO](#SEE_ALSO)

Type::Params, Type::Params::Parameter, Type::Params::Alternatives.

# [AUTHOR](#AUTHOR)

Toby Inkster &lt;tobyink@cpan.org&gt;.

# [COPYRIGHT AND LICENCE](#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](#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.

2026-10-25 perl v5.44.0

---

Document: Type::Params::Signature(3pm) from perl-type-tiny 2.010001-r4 (Chainguard OS)
Source: https://github.com/tobyink/p5-type-tiny
