GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Type::Tiny::Signatures(3) User Contributed Perl Documentation Type::Tiny::Signatures(3)

Type::Tiny::Signatures - Type::Tiny Method/Function Signatures

version 0.08

  use Type::Tiny;
  use Type::Tiny::Signatures;

  method hello (Str $greeting, Str $fullname) {
    print "$greeting, $fullname\n";
  }

This module uses Function::Parameters to extend Perl with keywords that let you define methods and functions with parameter lists which can be validated using Type::Tiny type constraints. The type constraints can be provided by the Type::Tiny standard library, Types::Standard, or any supported user-defined type library which can be a Moose, MooseX::Type, MouseX::Type, or Type::Library library.

  use Type::Tiny;
  use Type::Tiny::Signatures 'MyApp::Types';

  method identify (Str $name, SSN $number) {
    print "identifying $name using SSN $number\n";
  }

The method and function signatures can be configured to validate user-defined type constraints by passing the user-defined type library package name as an argument to the Type::Tiny::Signatures usage declaration. The default behavior configures the Function::Parameters pragma using options that mimick the previously default lax-mode, i.e. strict-mode disabled.

Al Newkirk <al@iamalnewkirk.com>

This software is copyright (c) 2018 by Al Newkirk.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2018-12-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.