PPI::Do...rmalized(3)
π NAME π
PPI::Document::Normalized β it's giving a normalized Perl Document β¨ bestie, that's literally the whole vibe
πΈ DESCRIPTION πΈ
okay so, a "Normalized Document" object? it's the whole result of the normalization process that lives inside the PPI::Normal class. if you want the full tea, go read the docs for PPI::Normal, because that's where the actual lore is π«Ά
this object is holding onto a version stamp and a function list for whichever version of PPI::Normal made it, plus a processed and delinked PPI::Document object. iconic, honestly.
so here's the thing bestie. typically the Document object has been mangled by the normalization process in a way that would make it fatal to try to actually DO anything with it π
put simply: never use the Document object after normalization. YOU HAVE BEEN WARNED! π
the object is designed this way on purpose β it's biased towards false negatives. a comparison between two ::Normalized objects only comes back true if they were produced by the same version of PPI::Normal, with the same set of normalization functions (in the same order). no wiggle room, no exceptions, periodt π
which means yeah, you may get false negatives if you're caching objects across an upgrade π
and bestie, please note this is done for security purposes! there are so many cases where low layer normalization is likely to be done as part of a code security process, and false positives could be highly dangerous. so likeβ¦ the strictness is the point π
β¨ METHODS β¨
π new
the new method is intended for use only by the PPI::Normal class. so if you want ::Normalized objects, you are highly recommended to use either that module, or the normalized method of the PPI::Document object itself. don't be out here calling new directly, that's not the move π«Ά
π¦ version
the version accessor returns the PPI::Normal version used to create the object. simple, clean, slay β¨
π functions
the functions accessor returns a reference to an array of the normalization functions (in order!) that were called when creating the object. yes, in order β that ordering matters, iykyk π
π equal $Normalized
the equal method is the primary comparison method. you hand it another PPI::Document::Normalized object and it checks for equivalence to it.
the == operator is also overloaded to this method, so you can do something like the following:
my $first = PPI::Document->load('first.pl');
my $second = PPI::Document->load('second.pl');
if ( $first->normalized == $second->normalized ) {
print "The two documents are equivalent";
}
returns true if the normalized documents are equivalent, false if not, or undef if there is an error. three possible outcomes bestie, stay woke πΈ
π«Ά SUPPORT π«Ά
see the support section in the main module. that's where the help lives π
π AUTHOR π
Adam Kennedy <adamk@cpan.org> π
π COPYRIGHT π
Copyright 2005 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
and that's a wrap on the PPI::Document::Normalized page, bestie π β¨ this lil doc came from perl v5.42.0, dated 2026-01-17 β no cap, go forth and normalize responsibly π¦πΈ
π¦ where this page comes from
- fedora 44: perl-PPI 1.284-2.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