/usr/share/perl5/perl5i/Signature.pod is in libperl5i-perl 2.13.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | =encoding utf8
=head1 NAME
perl5i::Signature - Representing what parameters a subroutine accepts
=head1 SYNOPSIS
func hello( $greeting, $place ) { say "$greeting, $place" }
my $code = \&hello;
my $signature = $code->signature;
say $signature->num_positional_params; # 2
say $signature->is_method; # false
=head1 DESCRIPTION
A Signature is a representation of what parameters a subroutine
accepts. Each subroutine defined with C<func> or C<method>
will have a signature associated with it. You can get at it by
calling the C<signature> method on the code reference. See
L<perl5i/Signature Introspection> for more details.
Subroutines declared with Perl's built in C<sub> will have no
signature.
=head1 METHODS
=head3 params
my $params = $sig->params;
An array ref of the parameters a subroutine takes in the order it
takes them. Currently they are just strings. In the future they will
be string overloaded objects.
=head3 positional_params
my $params = $sig->positional_params;
Like C<< $sig->params >> but it is just the positional parameters.
In the future there will be named parameters.
=head3 num_positional_params
my $num_positional_params = $sig->num_positional_params;
The number of named parameters the subroutine takes.
In the future there will be named parameters. For the purposes of
determining how many arguments a function takes, it is most useful to
look just at the positional ones.
This is mostly an optimization for C<< $sig->positional_params->size >>.
=head3 as_string
my $params = $sig->as_string;
The original signature string.
=head3 invocant
my $invocant = $sig->invocant;
The invocant is the object or class a method is called on.
C<invocant> will return the parameter which contains this, by default
it is C<$self> on a method, and nothing a regular subroutine.
=head3 is_method
my $is_method = $sig->is_method;
Returns if the subroutine was declared as a method.
=head1 OVERLOADING
Signature objects are string overloaded to return C<as_string>. They
are also I<always true> to avoid objects taking no parameters from
being confused with subroutines with no signatures.
|