NAME

Class::MakeMethods::Template::Ref - Universal copy and compare methods

SYNOPSIS

package MyObject;
use Class::MakeMethods::Template::Ref (
  'Hash:new'      => [ 'new' ],
  clone           => [ 'clone' ]
);

package main;

my $obj = MyObject->new( foo => ["Foozle", "Bozzle"] );
my $clone = $obj->clone();
print $obj->{'foo'}[1];

DESCRIPTION

The following types of methods are provided via the Class::MakeMethods interface:

clone

Produce a deep copy of an instance of almost any underlying datatype.

Parameters:

init_method

If defined, this method is called on the new object with any arguments passed in.

prototype

Create new instances by making a deep copy of a static prototypical instance.

Parameters:

init_method

If defined, this method is called on the new object with any arguments passed in.

compare

Compare one object to another.

Templates

  • default

    Three-way (sorting-style) comparison.

  • equals

    Are these two objects equivalent?

  • identity

    Are these two references to the exact same object?

SEE ALSO

See Class::MakeMethods for a reference to the internals of the Class::MakeMethods framework.

See Class::MakeMethods::Utility::Ref for the clone and compare functions used above.

See Class::MakeMethods::ReadMe for distribution and support information.

LICENSE

Copyright 1998, 2000, 2001 Evolution Online Systems, Inc.

M. Simon Cavalletto, simonm@evolution.com

Copyright 2002, Matthew Simon Cavalletto.

Derived in part from Ref.pm, Copyright 1994, David Muir Sharnoff.