Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token/Data.pm |
Statements | Executed 11 statements in 344µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.18ms | 3.20ms | BEGIN@31 | PPI::Token::Data::
1 | 1 | 1 | 18µs | 38µs | BEGIN@30 | PPI::Token::Data::
1 | 1 | 1 | 12µs | 12µs | BEGIN@35 | PPI::Token::Data::
1 | 1 | 1 | 9µs | 51µs | BEGIN@34 | PPI::Token::Data::
1 | 1 | 1 | 5µs | 5µs | BEGIN@32 | PPI::Token::Data::
0 | 0 | 0 | 0s | 0s | __TOKENIZER__on_char | PPI::Token::Data::
0 | 0 | 0 | 0s | 0s | handle | PPI::Token::Data::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package PPI::Token::Data; | ||||
2 | |||||
3 | =pod | ||||
4 | |||||
5 | =head1 NAME | ||||
6 | |||||
7 | PPI::Token::Data - The actual data in the __DATA__ section of a file | ||||
8 | |||||
9 | =head1 INHERITANCE | ||||
10 | |||||
11 | PPI::Token::Data | ||||
12 | isa PPI::Token | ||||
13 | isa PPI::Element | ||||
14 | |||||
15 | =head1 DESCRIPTION | ||||
16 | |||||
17 | The C<PPI::Token::Data> class is used to represent the actual data inside | ||||
18 | a file's C<__DATA__> section. | ||||
19 | |||||
20 | One C<PPI::Token::Data> object is used to represent the entire of the data, | ||||
21 | primarily so that it can provide a convenient handle directly to the data. | ||||
22 | |||||
23 | =head1 METHODS | ||||
24 | |||||
25 | C<PPI::Token::Data> provides one method in addition to those provided by | ||||
26 | our parent L<PPI::Token> and L<PPI::Element> classes. | ||||
27 | |||||
28 | =cut | ||||
29 | |||||
30 | 2 | 29µs | 2 | 58µs | # spent 38µs (18+20) within PPI::Token::Data::BEGIN@30 which was called:
# once (18µs+20µs) by PPI::Token::BEGIN@72 at line 30 # spent 38µs making 1 call to PPI::Token::Data::BEGIN@30
# spent 20µs making 1 call to strict::import |
31 | 2 | 148µs | 1 | 3.20ms | # spent 3.20ms (2.18+1.02) within PPI::Token::Data::BEGIN@31 which was called:
# once (2.18ms+1.02ms) by PPI::Token::BEGIN@72 at line 31 # spent 3.20ms making 1 call to PPI::Token::Data::BEGIN@31 |
32 | 2 | 28µs | 1 | 5µs | # spent 5µs within PPI::Token::Data::BEGIN@32 which was called:
# once (5µs+0s) by PPI::Token::BEGIN@72 at line 32 # spent 5µs making 1 call to PPI::Token::Data::BEGIN@32 |
33 | |||||
34 | 2 | 40µs | 2 | 93µs | # spent 51µs (9+42) within PPI::Token::Data::BEGIN@34 which was called:
# once (9µs+42µs) by PPI::Token::BEGIN@72 at line 34 # spent 51µs making 1 call to PPI::Token::Data::BEGIN@34
# spent 42µs making 1 call to vars::import |
35 | # spent 12µs within PPI::Token::Data::BEGIN@35 which was called:
# once (12µs+0s) by PPI::Token::BEGIN@72 at line 38 | ||||
36 | 1 | 500ns | $VERSION = '1.215'; | ||
37 | 1 | 12µs | @ISA = 'PPI::Token'; | ||
38 | 1 | 84µs | 1 | 12µs | } # spent 12µs making 1 call to PPI::Token::Data::BEGIN@35 |
39 | |||||
- - | |||||
44 | ##################################################################### | ||||
45 | # Methods | ||||
46 | |||||
47 | =pod | ||||
48 | |||||
49 | =head2 handle | ||||
50 | |||||
51 | The C<handle> method returns a L<IO::String> handle that allows you | ||||
52 | to do all the normal handle-y things to the contents of the __DATA__ | ||||
53 | section of the file. | ||||
54 | |||||
55 | Unlike in perl itself, this means you can also do things like C<print> | ||||
56 | new data onto the end of the __DATA__ section, or modify it with | ||||
57 | any other process that can accept an L<IO::Handle> as input or output. | ||||
58 | |||||
59 | Returns an L<IO::String> object. | ||||
60 | |||||
61 | =cut | ||||
62 | |||||
63 | sub handle { | ||||
64 | my $self = shift; | ||||
65 | IO::String->new( \$self->{content} ); | ||||
66 | } | ||||
67 | |||||
68 | sub __TOKENIZER__on_char { 1 } | ||||
69 | |||||
70 | 1 | 3µs | 1; | ||
71 | |||||
72 | =pod | ||||
73 | |||||
74 | =head1 SUPPORT | ||||
75 | |||||
76 | See the L<support section|PPI/SUPPORT> in the main module. | ||||
77 | |||||
78 | =head1 AUTHOR | ||||
79 | |||||
80 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||||
81 | |||||
82 | =head1 COPYRIGHT | ||||
83 | |||||
84 | Copyright 2001 - 2011 Adam Kennedy. | ||||
85 | |||||
86 | This program is free software; you can redistribute | ||||
87 | it and/or modify it under the same terms as Perl itself. | ||||
88 | |||||
89 | The full text of the license can be found in the | ||||
90 | LICENSE file included with this module. | ||||
91 | |||||
92 | =cut |