← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:05 2021

Filename/usr/local/lib/perl5/site_perl/Specio/DeclaredAt.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sSpecio::DeclaredAt::::BEGIN@3Specio::DeclaredAt::BEGIN@3
0000s0sSpecio::DeclaredAt::::BEGIN@4Specio::DeclaredAt::BEGIN@4
0000s0sSpecio::DeclaredAt::::BEGIN@8Specio::DeclaredAt::BEGIN@8
0000s0sSpecio::DeclaredAt::::_attrsSpecio::DeclaredAt::_attrs
0000s0sSpecio::DeclaredAt::::descriptionSpecio::DeclaredAt::description
0000s0sSpecio::DeclaredAt::::new_from_callerSpecio::DeclaredAt::new_from_caller
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Specio::DeclaredAt;
2
3use strict;
4use warnings;
5
6our $VERSION = '0.47';
7
8use Specio::OO;
9
10{
11 my $attrs = {
12 package => {
13 isa => 'Str',
14 required => 1,
15 },
16 filename => {
17 isa => 'Str',
18 required => 1,
19 },
20 line => {
21 isa => 'Int',
22 required => 1,
23 },
24 subroutine => {
25 isa => 'Str',
26 predicate => 'has_subroutine',
27 },
28 };
29
30 ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
31 sub _attrs {
32 return $attrs;
33 }
34}
35
36sub new_from_caller {
37 my $class = shift;
38 my $depth = shift;
39
40 my %p;
41 @p{qw( package filename line )} = ( caller($depth) )[ 0, 1, 2 ];
42
43 my $sub = ( caller( $depth + 1 ) )[3];
44 $p{subroutine} = $sub if defined $sub;
45
46 return $class->new(%p);
47}
48
49sub description {
50 my $self = shift;
51
52 my $package = $self->package;
53 my $filename = $self->filename;
54 my $line = $self->line;
55
56 my $desc = "declared in package $package ($filename) at line $line";
57 if ( $self->has_subroutine ) {
58 $desc .= ' in sub named ' . $self->subroutine;
59 }
60
61 return $desc;
62}
63
64__PACKAGE__->_ooify;
65
661;
67
68# ABSTRACT: A class to represent where a type or coercion was declared
69
70__END__