Clone(3) User Contributed Perl Documentation Clone(3)
NAME
Clone - recursively copy Perl datatypes
SYNOPSIS
use Clone;
push @Foo::ISA, 'Clone';
$a = new Foo;
$b = $a->clone();
# or
use Clone qw(clone);
$a = { 'foo' => 'bar', 'move' => 'zig' };
$b = [ 'alpha', 'beta', 'gamma', 'vlissides' ];
$c = new Foo();
$d = clone($a);
$e = clone($b);
$f = clone($c);
DESCRIPTION
This module provides a clone() method which makes recursive copies of nested hash, array,
scalar and reference types, including tied variables and objects.
clone() takes a scalar argument and an optional parameter that can be used to limit the
depth of the copy. To duplicate lists, arrays or hashes, pass them in by reference. e.g.
my $copy = clone (\@array);
# or
my %copy = %{ clone (\%hash) };
For a slower, but more flexible solution see Storable's dclone().
AUTHOR
Ray Finch, rdf AT cpan.org
Copyright 2001 Ray Finch.
This module is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
SEE ALSO
Storable(3).
perl v5.8.3 2003-09-08 Clone(3)
Generated by $Id: phpMan.php,v 4.49 2006/02/26 13:18:18 chedong Exp $ Author: Che Dong
On Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Under GNU General Public License
2009-01-06 19:04 @38.103.63.57 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html)