← 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/Token/Regexp.pm
StatementsExecuted 9 statements in 166µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11111µs22µsPPI::Token::Regexp::::BEGIN@45PPI::Token::Regexp::BEGIN@45
1117µs7µsPPI::Token::Regexp::::BEGIN@49PPI::Token::Regexp::BEGIN@49
1116µs34µsPPI::Token::Regexp::::BEGIN@48PPI::Token::Regexp::BEGIN@48
1113µs3µsPPI::Token::Regexp::::BEGIN@46PPI::Token::Regexp::BEGIN@46
0000s0sPPI::Token::Regexp::::get_delimitersPPI::Token::Regexp::get_delimiters
0000s0sPPI::Token::Regexp::::get_match_stringPPI::Token::Regexp::get_match_string
0000s0sPPI::Token::Regexp::::get_modifiersPPI::Token::Regexp::get_modifiers
0000s0sPPI::Token::Regexp::::get_substitute_stringPPI::Token::Regexp::get_substitute_string
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package PPI::Token::Regexp;
2
3=pod
4
5=head1 NAME
6
7PPI::Token::Regexp - Regular expression abstract base class
8
9=head1 INHERITANCE
10
11 PPI::Token::Regexp
12 isa PPI::Token
13 isa PPI::Element
14
15=head1 DESCRIPTION
16
17The C<PPI::Token::Regexp> class is never instantiated, and simply
18provides a common abstract base class for the three regular expression
19classes. These being:
20
21=over 2
22
23=item m// - L<PPI::Token::Regexp::Match>
24
25=item s/// - L<PPI::Token::Regexp::Substitute>
26
27=item tr/// - L<PPI::Token::Regexp::Transliterate>
28
29=back
30
31The names are hopefully obvious enough not to have to explain what
32each class is. See their pages for more details.
33
34To save some confusion, it's worth pointing out here that C<qr//> is
35B<not> a regular expression (which PPI takes to mean something that
36will actually examine or modify a string), but rather a quote-like
37operator that acts as a constructor for compiled L<Regexp> objects.
38
39=head1 METHODS
40
41The following methods are inherited by this class' offspring:
42
43=cut
44
45217µs233µs
# spent 22µs (11+11) within PPI::Token::Regexp::BEGIN@45 which was called: # once (11µs+11µs) by PPI::Token::Regexp::Match::BEGIN@46 at line 45
use strict;
# spent 22µs making 1 call to PPI::Token::Regexp::BEGIN@45 # spent 11µs making 1 call to strict::import
46221µs13µs
# spent 3µs within PPI::Token::Regexp::BEGIN@46 which was called: # once (3µs+0s) by PPI::Token::Regexp::Match::BEGIN@46 at line 46
use PPI::Token ();
# spent 3µs making 1 call to PPI::Token::Regexp::BEGIN@46
47
48226µs261µs
# spent 34µs (6+27) within PPI::Token::Regexp::BEGIN@48 which was called: # once (6µs+27µs) by PPI::Token::Regexp::Match::BEGIN@46 at line 48
use vars qw{$VERSION @ISA};
# spent 34µs making 1 call to PPI::Token::Regexp::BEGIN@48 # spent 27µs making 1 call to vars::import
49
# spent 7µs within PPI::Token::Regexp::BEGIN@49 which was called: # once (7µs+0s) by PPI::Token::Regexp::Match::BEGIN@46 at line 52
BEGIN {
501400ns $VERSION = '1.215';
5118µs @ISA = 'PPI::Token';
52192µs17µs}
# spent 7µs making 1 call to PPI::Token::Regexp::BEGIN@49
53
- -
58#####################################################################
59# PPI::Token::Regexp Methods
60
61=pod
62
63=head2 get_match_string
64
65The C<get_match_string> method returns the portion of the regexp that
66performs the match.
67
68=cut
69
70sub get_match_string {
71 return $_[0]->_section_content( 0 );
72}
73
74=pod
75
76=head2 get_substitute_string
77
78The C<get_substitute_string> method returns the portion of the regexp
79that is substituted for the match, if any. If the regexp does not
80substitute, C<undef> is returned.
81
82=cut
83
84sub get_substitute_string {
85 return $_[0]->_section_content( 1 );
86}
87
88=pod
89
90=head2 get_modifiers
91
92The C<get_modifiers> method returns the modifiers of the regexp.
93
94=cut
95
96sub get_modifiers {
97 return $_[0]->_modifiers();
98}
99
100=pod
101
102=head2 get_delimiters
103
104The C<get_delimiters> method returns the delimiters of the regexp as
105an array. The first element is the delimiters of the match string, and
106the second element (if any) is the delimiters of the substitute string
107(if any).
108
109=cut
110
111sub get_delimiters {
112 return $_[0]->_delimiters();
113}
114
115
11612µs1;
117
118=pod
119
120=head1 SUPPORT
121
122See the L<support section|PPI/SUPPORT> in the main module.
123
124=head1 AUTHOR
125
126Adam Kennedy E<lt>adamk@cpan.orgE<gt>
127
128=head1 COPYRIGHT
129
130Copyright 2001 - 2011 Adam Kennedy.
131
132This program is free software; you can redistribute
133it and/or modify it under the same terms as Perl itself.
134
135The full text of the license can be found in the
136LICENSE file included with this module.
137
138=cut