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)

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 perl v5.42.3 and is dated 2026-10-19. that's the tea, bestie β€” now go use PPI responsibly. πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from