NAME

UNIVERSAL::clone - add clone method to all classes and objects

SYNOPSIS

use UNIVERSAL::clone;

$foo = new Foo;
$bar = $foo->clone;                  # $bar is a copy of $foo itself
$bar = $foo->clone( $something );    # $bar is a copy of $something

# or

use UNIVERSAL::clone qw(Storable);    # use Storable::dclone
use UNIVERSAL::clone qw(Clone);       # use Clone::clone (default)

DESCRIPTION

Loading the UNIVERSAL::clone module adds clone method to all classes and methods. You can get a 'complete' copy of an object. This kind of copying is known as deep (recursive) copy. See Storable or Clone perldoc for more details.

Internally Clone::clone() is called by default, but you can use standard Storable module instead (but slower. plus, GLOB and CODE references are not acceptable).

SEE ALSO

Storable, Clone

AUTHOR

Okamoto RYO <ryo@aquahill.net>