GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MakeMethods::Template::Ref(3) User Contributed Perl Documentation MakeMethods::Template::Ref(3)

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

  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];

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

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.

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 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 Class::MakeMethods for general information about this distribution.

See Class::MakeMethods::Template for more about this family of subclasses.

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

2004-09-06 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.