1 package PPI::Document::Fragment;
7 PPI::Document::Fragment - A fragment of a Perl Document
11 In some situations you might want to work with a fragment of a larger
12 document. C<PPI::Document::Fragment> is a class intended for this purpose.
13 It is functionally almost identical to a normal L<PPI::Document>, except
14 that it is not possible to get line/column positions for the elements
15 within it, and it does not represent a scope.
24 use vars qw{$VERSION @ISA};
27 @ISA = 'PPI::Document';
34 #####################################################################
35 # PPI::Document Methods
39 =head2 index_locations
41 Unlike when called on a PPI::Document object, you should not be attempting
42 to find locations of things within a PPI::Document::Fragment, and thus any
43 call to the C<index_locations> will print a warning and return C<undef>
44 instead of attempting to index the locations of the Elements.
48 # There's no point indexing a fragment
50 warn "Useless attempt to index the locations of a document fragment";
58 #####################################################################
59 # PPI::Element Methods
61 # We are not a scope boundary
62 ### XS -> PPI/XS.xs:_PPI_Document_Fragment__scope 0.903+
71 Integrate this into the rest of PPI so it has actual practical uses. The most
72 obvious would be to implement arbitrary cut/copy/paste more easily.
76 See the L<support section|PPI/SUPPORT> in the main module.
80 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
84 Copyright 2001 - 2009 Adam Kennedy.
86 This program is free software; you can redistribute
87 it and/or modify it under the same terms as Perl itself.
89 The full text of the license can be found in the
90 LICENSE file included with this module.