1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!perl -w
use strict;
use Clone qw(clone);
use Data::Clone qw(data_clone);
use Storable qw(dclone);
use Errno qw(ENOENT);
use Devel::Peek;
use Data::Dumper;
our $errstr = 'foo';
my $data = { errstr_ref => \$errstr, errno_ref => \$! };
my $c1 = clone($data);
my $c2 = dclone($data);
my $c3 = data_clone($data);
$errstr = 'bar';
$! = ENOENT;
print Data::Dumper->Dump([$c1], ['Clone']);
print Data::Dumper->Dump([$c2], ['Storable']);
print Data::Dumper->Dump([$c3], ['DataClone']);
#Dump($c1);
#Dump($c2);
|