/usr/share/perl5/perl5i/2/Signature/Real.pm is in libperl5i-perl 2.12.0-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 | package perl5i::2::Signature::Real;
use perl5i::2;
use overload
q[""] => sub { return $_[0]->as_string },
fallback => 1
;
method new($class: %args) {
bless \%args, $class;
}
sub make_real () {}
method __parse_signature {
my $string = $self->{signature}->trim;
if( $string =~ s{^ (\$\w+) : \s*}{}x ) {
$self->{invocant} = $1 // '';
}
elsif( $self->is_method ) {
$self->{invocant} = '$self';
}
else {
$self->{invocant} = '';
}
my @args = split /\s*,\s*/, $string;
$self->{params} = \@args;
$self->{positional_params} = \@args;
$self->{num_positional_params} = @args;
return;
}
method num_positional_params() {
return $self->{num_positional_params};
}
method positional_params() {
return $self->{positional_params};
}
method params() {
return $self->{params};
}
method as_string() {
return $self->{signature};
}
method invocant() {
return $self->{invocant};
}
method is_method() {
return $self->{is_method};
}
1;
|