Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token/Quote/Interpolate.pm |
Statements | Executed 11 statements in 157µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 15µs | 27µs | BEGIN@31 | PPI::Token::Quote::Interpolate::
1 | 1 | 1 | 9µs | 9µs | BEGIN@36 | PPI::Token::Quote::Interpolate::
1 | 1 | 1 | 6µs | 34µs | BEGIN@35 | PPI::Token::Quote::Interpolate::
1 | 1 | 1 | 3µs | 3µs | BEGIN@32 | PPI::Token::Quote::Interpolate::
1 | 1 | 1 | 3µs | 3µs | BEGIN@33 | PPI::Token::Quote::Interpolate::
0 | 0 | 0 | 0s | 0s | string | PPI::Token::Quote::Interpolate::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package PPI::Token::Quote::Interpolate; | ||||
2 | |||||
3 | =pod | ||||
4 | |||||
5 | =head1 NAME | ||||
6 | |||||
7 | PPI::Token::Quote::Interpolate - The interpolation quote-like operator | ||||
8 | |||||
9 | =head1 INHERITANCE | ||||
10 | |||||
11 | PPI::Token::Quote::Interpolate | ||||
12 | isa PPI::Token::Quote | ||||
13 | isa PPI::Token | ||||
14 | isa PPI::Element | ||||
15 | |||||
16 | =head1 DESCRIPTION | ||||
17 | |||||
18 | A C<PPI::Token::Quote::Interpolate> object represents a single | ||||
19 | interpolation quote-like operator, such as C<qq{$foo bar $baz}>. | ||||
20 | |||||
21 | =head1 METHODS | ||||
22 | |||||
23 | There are no methods available for C<PPI::Token::Quote::Interpolate> | ||||
24 | beyond those provided by the parent L<PPI::Token::Quote>, L<PPI::Token> and | ||||
25 | L<PPI::Element> classes. | ||||
26 | |||||
27 | Got any ideas for methods? Submit a report to rt.cpan.org! | ||||
28 | |||||
29 | =cut | ||||
30 | |||||
31 | 2 | 20µs | 2 | 38µs | # spent 27µs (15+12) within PPI::Token::Quote::Interpolate::BEGIN@31 which was called:
# once (15µs+12µs) by PPI::Token::BEGIN@57 at line 31 # spent 27µs making 1 call to PPI::Token::Quote::Interpolate::BEGIN@31
# spent 12µs making 1 call to strict::import |
32 | 2 | 16µs | 1 | 3µs | # spent 3µs within PPI::Token::Quote::Interpolate::BEGIN@32 which was called:
# once (3µs+0s) by PPI::Token::BEGIN@57 at line 32 # spent 3µs making 1 call to PPI::Token::Quote::Interpolate::BEGIN@32 |
33 | 2 | 18µs | 1 | 3µs | # spent 3µs within PPI::Token::Quote::Interpolate::BEGIN@33 which was called:
# once (3µs+0s) by PPI::Token::BEGIN@57 at line 33 # spent 3µs making 1 call to PPI::Token::Quote::Interpolate::BEGIN@33 |
34 | |||||
35 | 2 | 30µs | 2 | 63µs | # spent 34µs (6+28) within PPI::Token::Quote::Interpolate::BEGIN@35 which was called:
# once (6µs+28µs) by PPI::Token::BEGIN@57 at line 35 # spent 34µs making 1 call to PPI::Token::Quote::Interpolate::BEGIN@35
# spent 28µs making 1 call to vars::import |
36 | # spent 9µs within PPI::Token::Quote::Interpolate::BEGIN@36 which was called:
# once (9µs+0s) by PPI::Token::BEGIN@57 at line 42 | ||||
37 | 1 | 300ns | $VERSION = '1.215'; | ||
38 | 1 | 9µs | @ISA = qw{ | ||
39 | PPI::Token::_QuoteEngine::Full | ||||
40 | PPI::Token::Quote | ||||
41 | }; | ||||
42 | 1 | 63µs | 1 | 9µs | } # spent 9µs making 1 call to PPI::Token::Quote::Interpolate::BEGIN@36 |
43 | |||||
- - | |||||
48 | ##################################################################### | ||||
49 | # PPI::Token::Quote Methods | ||||
50 | |||||
51 | =pod | ||||
52 | |||||
53 | =begin testing string 8 | ||||
54 | |||||
55 | my $Document = PPI::Document->new( \"print qq{foo}, qq!bar!, qq <foo>;" ); | ||||
56 | isa_ok( $Document, 'PPI::Document' ); | ||||
57 | my $Interpolate = $Document->find('Token::Quote::Interpolate'); | ||||
58 | is( scalar(@$Interpolate), 3, '->find returns three objects' ); | ||||
59 | isa_ok( $Interpolate->[0], 'PPI::Token::Quote::Interpolate' ); | ||||
60 | isa_ok( $Interpolate->[1], 'PPI::Token::Quote::Interpolate' ); | ||||
61 | isa_ok( $Interpolate->[2], 'PPI::Token::Quote::Interpolate' ); | ||||
62 | is( $Interpolate->[0]->string, 'foo', '->string returns as expected' ); | ||||
63 | is( $Interpolate->[1]->string, 'bar', '->string returns as expected' ); | ||||
64 | is( $Interpolate->[2]->string, 'foo', '->string returns as expected' ); | ||||
65 | |||||
66 | =end testing | ||||
67 | |||||
68 | =cut | ||||
69 | |||||
70 | sub string { | ||||
71 | my $self = shift; | ||||
72 | my @sections = $self->_sections; | ||||
73 | my $str = $sections[0]; | ||||
74 | substr( $self->{content}, $str->{position}, $str->{size} ); | ||||
75 | } | ||||
76 | |||||
77 | 1 | 2µs | 1; | ||
78 | |||||
79 | =pod | ||||
80 | |||||
81 | =head1 SUPPORT | ||||
82 | |||||
83 | See the L<support section|PPI/SUPPORT> in the main module. | ||||
84 | |||||
85 | =head1 AUTHOR | ||||
86 | |||||
87 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||||
88 | |||||
89 | =head1 COPYRIGHT | ||||
90 | |||||
91 | Copyright 2001 - 2011 Adam Kennedy. | ||||
92 | |||||
93 | This program is free software; you can redistribute | ||||
94 | it and/or modify it under the same terms as Perl itself. | ||||
95 | |||||
96 | The full text of the license can be found in the | ||||
97 | LICENSE file included with this module. | ||||
98 | |||||
99 | =cut |