1MakeMethods::Utility::RUesfe(r3)Contributed Perl DocumenMtaakteiMoenthods::Utility::Ref(3)
2
3
4
6 Class::MakeMethods::Utility::Ref - Deep copying and comparison
7
9 use Class::MakeMethods::Utility::Ref qw( ref_clone ref_compare );
10
11 $deep_copy = ref_clone( $original );
12 $positive_zero_or_negative = ref_compare( $item_a, $item_b );
13
15 This module provides utility functions to copy and compare arbitrary
16 references, including full traversal of nested data structures.
17
18 REFERENCE
19
20 The following functions are provided:
21
22 ref_clone()
23
24 Make a recursive copy of a reference.
25
26 ref_compare()
27
28 Attempt to recursively compare two references.
29
30 If they are not the same, try to be consistent about returning a posi‐
31 tive or negative number so that it can be used for sorting. The sort
32 order is kinda arbitrary.
33
35 See Class::MakeMethods for general information about this distribution.
36
37 See Ref for the original version of the clone and compare functions
38 used above.
39
40 See Clone (v0.09 on CPAN as of 2000-09-21) for a clone method with an
41 XS implementation.
42
43 The Perl6 RFP #67 proposes including clone functionality in the core.
44
45 See Data::Compare (v0.01 on CPAN as of 1999-04-24) for a Compare method
46 which checks two references for similarity, but it does not provide
47 positive/negative values for ordering purposes.
48
49
50
51perl v5.8.8 2004-09-06 MakeMethods::Utility::Ref(3)