← 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:12 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Document/Fragment.pm
StatementsExecuted 9 statements in 145µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs24µsPPI::Document::Fragment::::BEGIN@21PPI::Document::Fragment::BEGIN@21
1118µs8µsPPI::Document::Fragment::::BEGIN@25PPI::Document::Fragment::BEGIN@25
1117µs34µsPPI::Document::Fragment::::BEGIN@24PPI::Document::Fragment::BEGIN@24
1114µs4µsPPI::Document::Fragment::::BEGIN@22PPI::Document::Fragment::BEGIN@22
0000s0sPPI::Document::Fragment::::index_locationsPPI::Document::Fragment::index_locations
0000s0sPPI::Document::Fragment::::scopePPI::Document::Fragment::scope
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package PPI::Document::Fragment;
2
3=pod
4
5=head1 NAME
6
7PPI::Document::Fragment - A fragment of a Perl Document
8
9=head1 DESCRIPTION
10
11In some situations you might want to work with a fragment of a larger
12document. C<PPI::Document::Fragment> is a class intended for this purpose.
13It is functionally almost identical to a normal L<PPI::Document>, except
14that it is not possible to get line/column positions for the elements
15within it, and it does not represent a scope.
16
17=head1 METHODS
18
19=cut
20
21222µs236µs
# spent 24µs (12+12) within PPI::Document::Fragment::BEGIN@21 which was called: # once (12µs+12µs) by PPI::Document::BEGIN@86 at line 21
use strict;
# spent 24µs making 1 call to PPI::Document::Fragment::BEGIN@21 # spent 12µs making 1 call to strict::import
22220µs14µs
# spent 4µs within PPI::Document::Fragment::BEGIN@22 which was called: # once (4µs+0s) by PPI::Document::BEGIN@86 at line 22
use PPI::Document ();
# spent 4µs making 1 call to PPI::Document::Fragment::BEGIN@22
23
24228µs261µs
# spent 34µs (7+27) within PPI::Document::Fragment::BEGIN@24 which was called: # once (7µs+27µs) by PPI::Document::BEGIN@86 at line 24
use vars qw{$VERSION @ISA};
# spent 34µs making 1 call to PPI::Document::Fragment::BEGIN@24 # spent 27µs making 1 call to vars::import
25
# spent 8µs within PPI::Document::Fragment::BEGIN@25 which was called: # once (8µs+0s) by PPI::Document::BEGIN@86 at line 28
BEGIN {
261300ns $VERSION = '1.215';
27114µs @ISA = 'PPI::Document';
28160µs18µs}
# spent 8µs making 1 call to PPI::Document::Fragment::BEGIN@25
29
- -
34#####################################################################
35# PPI::Document Methods
36
37=pod
38
39=head2 index_locations
40
41Unlike when called on a PPI::Document object, you should not be attempting
42to find locations of things within a PPI::Document::Fragment, and thus any
43call to the C<index_locations> will print a warning and return C<undef>
44instead of attempting to index the locations of the Elements.
45
46=cut
47
48# There's no point indexing a fragment
49sub index_locations {
50 warn "Useless attempt to index the locations of a document fragment";
51 undef;
52}
53
- -
58#####################################################################
59# PPI::Element Methods
60
61# We are not a scope boundary
62### XS -> PPI/XS.xs:_PPI_Document_Fragment__scope 0.903+
63sub scope { '' }
64
6512µs1;
66
67=pod
68
69=head1 TO DO
70
71Integrate this into the rest of PPI so it has actual practical uses. The most
72obvious would be to implement arbitrary cut/copy/paste more easily.
73
74=head1 SUPPORT
75
76See the L<support section|PPI/SUPPORT> in the main module.
77
78=head1 AUTHOR
79
80Adam Kennedy E<lt>adamk@cpan.orgE<gt>
81
82=head1 COPYRIGHT
83
84Copyright 2001 - 2011 Adam Kennedy.
85
86This program is free software; you can redistribute
87it and/or modify it under the same terms as Perl itself.
88
89The full text of the license can be found in the
90LICENSE file included with this module.
91
92=cut