use threads;
use threads::shared;
use Data::Dumper;
sub clone {
my $ref = shift;
my $type = ref $ref;
if( $type eq 'HASH' ) {
return { map clone( $_ ), %{ $ref } };
}
elsif( $type eq 'ARRAY' ) {
return [ map clone( $_ ),@{ $ref } ];
}
elsif( $type eq 'REF' ) {
return \ clone( $$ref );
}
else {
return $ref;
}
}
my $x :shared = shared_clone({
a => 'Foo',
b => 'Bar'
});
my $z = clone( $x );
print Dumper( $z );
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|