07 Sep 2004 21:45:34 UTC
- Distribution: Class-MakeMethods
- Module version: 1
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (5044 / 238 / 0)
- KwaliteeBus factor: 0
- 69.84% Coverage
- License: unknown
- Activity24 month
- Download (158.37KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionEVO Matthew Simon Cavalletto
Class::MakeMethods::Utility::Ref - Deep copying and comparison
use Class::MakeMethods::Utility::Ref qw( ref_clone ref_compare ); $deep_copy = ref_clone( $original ); $positive_zero_or_negative = ref_compare( $item_a, $item_b );
This module provides utility functions to copy and compare arbitrary references, including full traversal of nested data structures.
The following functions are provided:
Make a recursive copy of a reference.
Attempt to recursively compare two references.
If they are not the same, try to be consistent about returning a positive or negative number so that it can be used for sorting. The sort order is kinda arbitrary.
See Class::MakeMethods for general information about this distribution.
See Ref for the original version of the clone and compare functions used above.
See Clone (v0.09 on CPAN as of 2000-09-21) for a clone method with an XS implementation.
The Perl6 RFP #67 proposes including clone functionality in the core.
See Data::Compare (v0.01 on CPAN as of 1999-04-24) for a Compare method which checks two references for similarity, but it does not provide positive/negative values for ordering purposes.
Module Install Instructions
To install Class::MakeMethods, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Class::MakeMethods
For more information on module installation, please visit the detailed CPAN module installation guide.