Server IP : 149.255.58.128 / Your IP : 216.73.216.145
System : Linux cloud516.thundercloud.uk 5.14.0-427.26.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 17 15:51:13 EDT 2024 x86_64
PHP Version : 8.2.28
Disable Function : allow_url_include, apache_child_terminate, apache_setenv, exec, passthru, pcntl_exec, posix_kill, posix_mkfifo, posix_getpwuid, posix_setpgid, posix_setsid, posix_setuid, posix_setgid, posix_seteuid, posix_setegid, posix_uname, proc_close, proc_get_status, proc_open, proc_terminate, shell_exec, show_source, system
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Upload Files :
Command :
Current File : /lib64/perl5/vendor_perl//Clone.pm
package Clone;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
require Exporter;
require DynaLoader;
require AutoLoader;
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw();
@EXPORT_OK = qw( clone );
$VERSION = '0.45';
bootstrap Clone $VERSION;
1;
__END__
=head1 NAME
Clone - recursively copy Perl datatypes
=for html
<a href="https://travis-ci.org/garu/Clone"><img src="https://travis-ci.org/garu/Clone.png?branch=master" alt="Build Status"></a>
<a href="https://coveralls.io/r/garu/Clone?branch=master"><img src="https://coveralls.io/repos/garu/Clone/badge.png?branch=master" alt="Coverage Status"></a>
<a href="https://metacpan.org/pod/Clone"><img src="https://badge.fury.io/pl/Clone.svg" alt="CPAN version"></a>
=head1 SYNOPSIS
use Clone 'clone';
my $data = {
set => [ 1 .. 50 ],
foo => {
answer => 42,
object => SomeObject->new,
},
};
my $cloned_data = clone($data);
$cloned_data->{foo}{answer} = 1;
print $cloned_data->{foo}{answer}; # '1'
print $data->{foo}{answer}; # '42'
You can also add it to your class:
package Foo;
use parent 'Clone';
sub new { bless {}, shift }
package main;
my $obj = Foo->new;
my $copy = $obj->clone;
=head1 DESCRIPTION
This module provides a C<clone()> method which makes recursive
copies of nested hash, array, scalar and reference types,
including tied variables and objects.
C<clone()> takes a scalar argument and duplicates it. To duplicate lists,
arrays or hashes, pass them in by reference, e.g.
my $copy = clone (\@array);
# or
my %copy = %{ clone (\%hash) };
=head1 SEE ALSO
L<Storable>'s C<dclone()> is a flexible solution for cloning variables,
albeit slower for average-sized data structures. Simple
and naive benchmarks show that Clone is faster for data structures
with 3 or fewer levels, while C<dclone()> can be faster for structures
4 or more levels deep.
=head1 COPYRIGHT
Copyright 2001-2019 Ray Finch. All Rights Reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 AUTHOR
Ray Finch C<< <rdf@cpan.org> >>
Breno G. de Oliveira C<< <garu@cpan.org> >> and
Florian Ragwitz C<< <rafl@debian.org> >> perform routine maintenance
releases since 2012.
=cut
Name |
Size |
Last Modified |
Owner / Group |
Permissions |
Options |
.. | -- | May 30 2024 07:43:02 | 0 / root | 0755 | |
Bundle | -- | February 07 2024 08:13:21 | 0 / root | 0755 | |
Compress | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
DBD | -- | February 07 2024 08:13:21 | 0 / root | 0755 | |
DBI | -- | February 05 2024 20:02:44 | 0 / root | 0755 | |
Data | -- | October 13 2023 17:01:25 | 0 / root | 0755 | |
Devel | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
Digest | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
Encode | -- | February 05 2024 19:59:45 | 0 / root | 0755 | |
File | -- | October 13 2023 17:01:26 | 0 / root | 0755 | |
Filter | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
HTML | -- | February 05 2024 20:06:14 | 0 / root | 0755 | |
IO | -- | February 05 2024 20:06:13 | 0 / root | 0755 | |
IPC | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
JSON | -- | February 05 2024 20:06:15 | 0 / root | 0755 | |
List | -- | December 04 2024 22:45:25 | 0 / root | 0755 | |
MIME | -- | October 13 2023 17:01:26 | 0 / root | 0755 | |
Math | -- | February 05 2024 19:59:43 | 0 / root | 0755 | |
Net | -- | December 04 2024 22:44:01 | 0 / root | 0755 | |
POD2 | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
Params | -- | February 05 2024 19:59:43 | 0 / root | 0755 | |
Scalar | -- | December 04 2024 22:45:25 | 0 / root | 0755 | |
Sub | -- | December 04 2024 22:45:25 | 0 / root | 0755 | |
Sys | -- | February 05 2024 19:59:43 | 0 / root | 0755 | |
Term | -- | October 13 2023 17:01:27 | 0 / root | 0755 | |
Text | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
Time | -- | February 05 2024 19:59:43 | 0 / root | 0755 | |
Unicode | -- | February 05 2024 19:59:44 | 0 / root | 0755 | |
YAML | -- | February 05 2024 20:06:15 | 0 / root | 0755 | |
auto | -- | April 03 2024 14:35:37 | 0 / root | 0755 | |
common | -- | February 05 2024 20:06:13 | 0 / root | 0755 | |
threads | -- | February 05 2024 19:59:43 | 0 / root | 0755 | |
version | -- | February 05 2024 19:59:43 | 0 / root | 0755 | |
| | | | | |
Clone.pm | 2.292 KB | April 23 2020 20:46:00 | 0 / root | 0644 | |
Cwd.pm | 21.428 KB | February 11 2022 16:16:09 | 0 / root | 0644 | |
DBI.pm | 310.741 KB | January 31 2020 15:27:40 | 0 / root | 0644 | |
DB_File.pm | 65.434 KB | February 16 2022 11:55:14 | 0 / root | 0644 | |
Encode.pm | 31.333 KB | February 11 2022 16:41:54 | 0 / root | 0644 | |
Socket.pm | 36.159 KB | January 05 2021 15:48:35 | 0 / root | 0644 | |
Storable.pm | 48.754 KB | February 14 2022 23:45:55 | 0 / root | 0644 | |
dbixs_rev.pl | 1.506 KB | February 16 2022 08:03:45 | 0 / root | 0755 | |
encoding.pm | 22.412 KB | December 02 2020 01:28:25 | 0 / root | 0644 | |
threads.pm | 37.062 KB | March 25 2022 11:46:33 | 0 / root | 0644 | |
version.pm | 3.466 KB | September 22 2020 18:16:32 | 0 / root | 0644 | |
version.pod | 9.602 KB | July 31 2020 16:44:44 | 0 / root | 0644 | |