Dist::Z...le::PPI(3)
π Dist::Zilla::Role::PPI π
okay so quick intro bestie β this is the manual page for Dist::Zilla::Role::PPI, and it lives in the User Contributed Perl Documentation collection. it's giving "role energy". π
β¨ NAME β¨
Dist::Zilla::Role::PPI β a role for plugins which use PPI π«Ά
πΈ VERSION πΈ
version 6.040 β that's the one, no cap.
π¦ DESCRIPTION π¦
This role provides some common utilities for plugins which use PPI. that's literally it, it's a little helper bestie that hands out shared goodies so every PPI-using plugin doesn't have to reinvent the wheel. iconic behavior honestly. π
β PERL VERSION β
This module should work on any version of perl still receiving updates from the Perl 5 Porters. β¨ so like, any perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) π
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. π The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so yeah β don't @ her about it.
π METHODS π
π ppi_document_for_file
my $document = $self->ppi_document_for_file($file);
Given a dzil file object (anything that does Dist::Zilla::Role::File), this method returns a new PPI::Document for that file's content. like, it just gives you the doc, periodt. πβ¨
Internally, this method caches these documents. If multiple plugins want a document for the same file, this avoids reparsing it. so if two plugins come knocking for the same file, they get the cached one β no redundant work, main character efficiency. π
π§ save_ppi_document_to_file
my $document = $self->save_ppi_document_to_file($document,$file);
Given a PPI::Document and a dzil file object (anything that does Dist::Zilla::Role::File), this method saves the serialized document in the file. πΎ
It also updates the internal PPI document cache with the new document. so the cache stays in sync β no stale vibes allowed around here. π«π
π document_assigns_to_variable
if( $self->document_assigns_to_variable($document, '$FOO')) { ... }
This method returns true if the document assigns to the given variable (the sigil must be included). so yes bestie, that $ goes in there β include the sigil or it won't vibe check. π«Ά
π AUTHOR π
Ricardo SIGNES π <cpan@semiotic.systems>
(the π is part of the whole brand, we respect it)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2026 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πΈ legally free, morally slay.
π cute lil sign-off: this page shipped with perlv5.42.3and is dated2026-10-19. that's the tea, bestie β now go use PPI responsibly. πβ¨π
π¦ where this page comes from
- fedora 44: perl-Dist-Zilla 6.040-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms