1Dist::Zilla::Role::PPI(U3s)er Contributed Perl DocumentatDiiosnt::Zilla::Role::PPI(3)
2
3
4
6 Dist::Zilla::Role::PPI - a role for plugins which use PPI
7
9 version 6.031
10
12 This role provides some common utilities for plugins which use PPI.
13
15 This module should work on any version of perl still receiving updates
16 from the Perl 5 Porters. This means it should work on any version of
17 perl released in the last two to three years. (That is, if the most
18 recently released version is v5.40, then this module should work on
19 both v5.40 and v5.38.)
20
21 Although it may work on older versions of perl, no guarantee is made
22 that the minimum required version will not be increased. The version
23 may be increased for any reason, and there is no promise that patches
24 will be accepted to lower the minimum required perl.
25
27 ppi_document_for_file
28 my $document = $self->ppi_document_for_file($file);
29
30 Given a dzil file object (anything that does Dist::Zilla::Role::File),
31 this method returns a new PPI::Document for that file's content.
32
33 Internally, this method caches these documents. If multiple plugins
34 want a document for the same file, this avoids reparsing it.
35
36 save_ppi_document_to_file
37 my $document = $self->save_ppi_document_to_file($document,$file);
38
39 Given a PPI::Document and a dzil file object (anything that does
40 Dist::Zilla::Role::File), this method saves the serialized document in
41 the file.
42
43 It also updates the internal PPI document cache with the new document.
44
45 document_assigns_to_variable
46 if( $self->document_assigns_to_variable($document, '$FOO')) { ... }
47
48 This method returns true if the document assigns to the given variable
49 (the sigil must be included).
50
52 Ricardo SIGNES 😏 <cpan@semiotic.systems>
53
55 This software is copyright (c) 2023 by Ricardo SIGNES.
56
57 This is free software; you can redistribute it and/or modify it under
58 the same terms as the Perl 5 programming language system itself.
59
60
61
62perl v5.38.0 2023-11-21 Dist::Zilla::Role::PPI(3)