1PPI::Document::NormalizUesde(r3)Contributed Perl DocumenPtPaIt:i:oDnocument::Normalized(3)
2
3
4
6 PPI::Document::Normalized - A normalized Perl Document
7
9 A "Normalized Document" object is the result of the normalization
10 process contained in the PPI::Normal class. See the documentation for
11 PPI::Normal for more information.
12
13 The object contains a version stamp and function list for the version
14 of PPI::Normal used to create it, and a processed and delinked
15 PPI::Document object.
16
17 Typically, the Document object will have been mangled by the
18 normalization process in a way that would make it fatal to try to
19 actually DO anything with it.
20
21 Put simply, never use the Document object after normalization. YOU
22 HAVE BEEN WARNED!
23
24 The object is designed the way it is to provide a bias towards false
25 negatives. A comparison between two ::Normalized object will only
26 return true if they were produced by the same version of PPI::Normal,
27 with the same set of normalization functions (in the same order).
28
29 You may get false negatives if you are caching objects across an
30 upgrade.
31
32 Please note that this is done for security purposes, as there are many
33 cases in which low layer normalization is likely to be done as part of
34 a code security process, and false positives could be highly dangerous.
35
37 new
38 The "new" method is intended for use only by the PPI::Normal class, and
39 to get ::Normalized objects, you are highly recommended to use either
40 that module, or the "normalized" method of the PPI::Document object
41 itself.
42
43 version
44 The "version" accessor returns the PPI::Normal version used to create
45 the object.
46
47 functions
48 The "functions" accessor returns a reference to an array of the
49 normalization functions (in order) that were called when creating the
50 object.
51
52 equal $Normalized
53 The "equal" method is the primary comparison method, taking another
54 PPI::Document::Normalized object, and checking for equivalence to it.
55
56 The "==" operator is also overload to this method, so that you can do
57 something like the following:
58
59 my $first = PPI::Document->load('first.pl');
60 my $second = PPI::Document->load('second.pl');
61
62 if ( $first->normalized == $second->normalized ) {
63 print "The two documents are equivalent";
64 }
65
66 Returns true if the normalized documents are equivalent, false if not,
67 or "undef" if there is an error.
68
70 See the support section in the main module.
71
73 Adam Kennedy <adamk@cpan.org>
74
76 Copyright 2005 - 2011 Adam Kennedy.
77
78 This program is free software; you can redistribute it and/or modify it
79 under the same terms as Perl itself.
80
81 The full text of the license can be found in the LICENSE file included
82 with this module.
83
84
85
86perl v5.38.0 2023-09-22 PPI::Document::Normalized(3)