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 30 31 32 33
|
#!perl -w
use strict;
use constant HUF => eval{ require Hash::Util::FieldHash };
use Test::More HUF ? (tests => 8) : (skip_all => 'require Hash::Util::FieldHash');
use Hash::FieldHash;
Hash::FieldHash::fieldhash my %x;
Hash::Util::FieldHash::fieldhash my %y;
{
my $o = [];
$x{$o} = 100;
$y{$o} = 200;
is_deeply [values %x], [100];
is_deeply [values %y], [200];
is $x{$o}, 100;
is $y{$o}, 200;
$x{$o}++;
$y{$o}++;
is $x{$o}, 101;
is $y{$o}, 201;
}
is_deeply \%x, {};
is_deeply \%y, {};
|