use Test::Most; use Test::Refcount; use Solaris::kstat; use Clone qw(); my $k = Solaris::kstat->new(); # 'Freeze' kstat data for cpu 0: ok( defined($k->{'cpu'}->{0}->{sys}), 'CPU kstat should be defined'); # Clone the data my $c1 = Clone::clone($k); # Compare the keys/values under the above, as they should remain the same foreach my $key (keys %{$k->{cpu}->{0}->{sys}}) { eq_or_diff($c1->{cpu}->{0}->{sys}->{$key}, $k->{cpu}->{0}->{sys}->{$key}, "Clone::clone cpu:0:sys:$key should be identical"); } done_testing();