3 # Copyright (c) 1995-2000, Raphael Manfredi
5 # You may redistribute only under the same terms as Perl 5, as specified
6 # in the README file that comes with the distribution.
10 # Tests ref to items in tied hash/array structures.
15 unshift @INC, 't/compat' if $] < 5.006002;
16 require Config; import Config;
17 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
18 print "1..0 # Skip: Storable was not built\n";
25 use Storable qw(dclone);
26 use Test::More tests => 8;
30 sub H::TIEHASH { bless \(my $x), "H" }
31 sub H::FETCH { $h_fetches++; $_[1] - 70 }
45 sub A::TIEARRAY { bless \(my $x), "A" }
46 sub A::FETCH { $a_fetches++; $_[1] - 70 }
56 # a bug in 5.12 and earlier caused an extra FETCH
57 is($a_fetches, $] < 5.013 ? 3 : 2);