.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PPI::Document::Normalized 3pm" .TH PPI::Document::Normalized 3pm "2019-07-21" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PPI::Document::Normalized \- A normalized Perl Document .SH "DESCRIPTION" .IX Header "DESCRIPTION" A \f(CW\*(C`Normalized Document\*(C'\fR object is the result of the normalization process contained in the PPI::Normal class. See the documentation for PPI::Normal for more information. .PP The object contains a version stamp and function list for the version of PPI::Normal used to create it, and a processed and delinked PPI::Document object. .PP Typically, the Document object will have been mangled by the normalization process in a way that would make it fatal to try to actually \s-1DO\s0 anything with it. .PP Put simply, \fBnever\fR use the Document object after normalization. \&\fB\s-1YOU HAVE BEEN WARNED\s0!\fR .PP The object is designed the way it is to provide a bias towards false negatives. A comparison between two ::Normalized object will only return true if they were produced by the same version of PPI::Normal, with the same set of normalization functions (in the same order). .PP You may get false negatives if you are caching objects across an upgrade. .PP Please note that this is done for security purposes, as there are many cases in which low layer normalization is likely to be done as part of a code security process, and false positives could be highly dangerous. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" The \f(CW\*(C`new\*(C'\fR method is intended for use only by the PPI::Normal class, and to get ::Normalized objects, you are highly recommended to use either that module, or the \f(CW\*(C`normalized\*(C'\fR method of the PPI::Document object itself. .SS "version" .IX Subsection "version" The \f(CW\*(C`version\*(C'\fR accessor returns the PPI::Normal version used to create the object. .SS "functions" .IX Subsection "functions" The \f(CW\*(C`functions\*(C'\fR accessor returns a reference to an array of the normalization functions (in order) that were called when creating the object. .ie n .SS "equal $Normalized" .el .SS "equal \f(CW$Normalized\fP" .IX Subsection "equal $Normalized" The \f(CW\*(C`equal\*(C'\fR method is the primary comparison method, taking another PPI::Document::Normalized object, and checking for equivalence to it. .PP The \f(CW\*(C`==\*(C'\fR operator is also overload to this method, so that you can do something like the following: .PP .Vb 2 \& my $first = PPI::Document\->load(\*(Aqfirst.pl\*(Aq); \& my $second = PPI::Document\->load(\*(Aqsecond.pl\*(Aq); \& \& if ( $first\->normalized == $second\->normalized ) { \& print "The two documents are equivalent"; \& } .Ve .PP Returns true if the normalized documents are equivalent, false if not, or \f(CW\*(C`undef\*(C'\fR if there is an error. .SH "SUPPORT" .IX Header "SUPPORT" See the support section in the main module. .SH "AUTHOR" .IX Header "AUTHOR" Adam Kennedy .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2005 \- 2011 Adam Kennedy. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \&\s-1LICENSE\s0 file included with this module.