Kavorka::Manual::PrototypeAndAttributes(3pm)

Kavorka::Manual::PrototypeAndAttributes3pm

The more rarely used features of perl subroutines

Overview

The Prototype

Like with the sub keyword, a prototype may be provided for functions. Method dispatch ignores this, so it's only likely to be useful for "fun", and even then, rarely.

Like Function::Parameters, Kavorka uses ":(...)" to indicate a prototype. This avoids ambiguity between signatures, prototypes and attributes.

For compatibility with Perl 5.20, the special attribute ":prototype(...)" is supported as an alternative mechanism for expressing prototypes.

The Attributes

Attributes are parsed as per "Subroutine Attributes" in perlsub.

For anonymous functions, some attributes (e.g. ":lvalue") may be applied too late to take effect. Attributes should mostly work for named functions though.

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.

Releases

2 releases since Debian 9 (Stretch); the text changed 1 time.

  1. 9
  2. 10

Bugs

Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=Kavorka>.

Author

Toby Inkster <[email protected]>.

From libkavorka-perl 0.039-3 in Debian 10 (Buster). Parsed by carta from the page's man source.