← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:10 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Exception.pm
StatementsExecuted 8 statements in 232µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs24µsPPI::Exception::::BEGIN@3PPI::Exception::BEGIN@3
1117µs24µsPPI::Exception::::BEGIN@6PPI::Exception::BEGIN@6
1117µs28µsPPI::Exception::::BEGIN@4PPI::Exception::BEGIN@4
1113µs3µsPPI::Exception::::BEGIN@7PPI::Exception::BEGIN@7
0000s0sPPI::Exception::::callersPPI::Exception::callers
0000s0sPPI::Exception::::messagePPI::Exception::message
0000s0sPPI::Exception::::newPPI::Exception::new
0000s0sPPI::Exception::::throwPPI::Exception::throw
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package PPI::Exception;
2
3222µs236µs
# spent 24µs (12+12) within PPI::Exception::BEGIN@3 which was called: # once (12µs+12µs) by PPI::Token::BEGIN@26 at line 3
use strict;
# spent 24µs making 1 call to PPI::Exception::BEGIN@3 # spent 12µs making 1 call to strict::import
4221µs249µs
# spent 28µs (7+21) within PPI::Exception::BEGIN@4 which was called: # once (7µs+21µs) by PPI::Token::BEGIN@26 at line 4
use Params::Util qw{_INSTANCE};
# spent 28µs making 1 call to PPI::Exception::BEGIN@4 # spent 21µs making 1 call to Exporter::import
5
6223µs241µs
# spent 24µs (7+17) within PPI::Exception::BEGIN@6 which was called: # once (7µs+17µs) by PPI::Token::BEGIN@26 at line 6
use vars qw{$VERSION};
# spent 24µs making 1 call to PPI::Exception::BEGIN@6 # spent 17µs making 1 call to vars::import
7
# spent 3µs within PPI::Exception::BEGIN@7 which was called: # once (3µs+0s) by PPI::Token::BEGIN@26 at line 9
BEGIN {
814µs $VERSION = '1.215';
91160µs13µs}
# spent 3µs making 1 call to PPI::Exception::BEGIN@7
10
- -
15#####################################################################
16# Constructor and Accessors
17
18sub new {
19 my $class = shift;
20 return bless { @_ }, $class if @_ > 1;
21 return bless { message => $_[0] }, $class if @_;
22 return bless { message => 'Unknown Exception' }, $class;
23}
24
25sub message {
26 $_[0]->{message};
27}
28
29sub callers {
30 @{ $_[0]->{callers} || [] };
31}
32
- -
37#####################################################################
38# Main Methods
39
40sub throw {
41 my $it = shift;
42 if ( _INSTANCE($it, 'PPI::Exception') ) {
43 if ( $it->{callers} ) {
44 push @{ $it->{callers} }, [ caller(0) ];
45 } else {
46 $it->{callers} ||= [];
47 }
48 } else {
49 my $message = $_[0] || 'Unknown Exception';
50 $it = $it->new(
51 message => $message,
52 callers => [
53 [ caller(0) ],
54 ],
55 );
56 }
57 die $it;
58}
59
6012µs1;