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 normaliza‐
18 tion process in a way that would make it fatal to try to actually DO
19 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
39 The "new" method is intended for use only by the PPI::Normal class, and
40 to get ::Normalized objects, you are highly recommended to use either
41 that module, or the "normalized" method of the PPI::Document object
42 itself.
43
44 version
45
46 The "version" accessor returns the PPI::Normal version used to create
47 the object.
48
49 functions
50
51 The "functions" accessor returns a reference to an array of the normal‐
52 ization functions (in order) that were called when creating the object.
53
54 equal $Normalized
55
56 The "equal" method is the primary comparison method, taking another
57 PPI::Document::Normalized object, and checking for equivalence to it.
58
59 The "==" operator is also overload to this method, so that you can do
60 something like the following:
61
62 my $first = PPI::Document->load('first.pl');
63 my $second = PPI::Document->load('second.pl');
64
65 if ( $first->normalized == $second->normalized ) {
66 print "The two documents are equivalent";
67 }
68
69 Returns true if the normalized documents are equivalent, false if not,
70 or "undef" if there is an error.
71
73 See the support section in the main module.
74
76 Adam Kennedy <adamk@cpan.org>
77
79 Copyright (c) 2005 Adam Kennedy. All rights reserved.
80
81 This program is free software; you can redistribute it and/or modify it
82 under the same terms as Perl itself.
83
84 The full text of the license can be found in the LICENSE file included
85 with this module.
86
87
88
89perl v5.8.8 2006-09-23 PPI::Document::Normalized(3)