7 $h{'jkl','mno'} = "JKL\034MNO";
8 $h{'a',2,3,4,5} = join("\034",'A',2,3,4,5);
39 if ($#keys == 29 && $#values == 29) {print "ok 1\n";} else {print "not ok 1\n";}
41 $i = 0; # stop -w complaints
43 while (($key,$value) = each(%h)) {
44 if ($key eq $keys[$i] && $value eq $values[$i]
45 && (('a' lt 'A' && $key lt $value) || $key gt $value)) {
47 $i++ if $key eq $value;
51 if ($i == 30) {print "ok 2\n";} else {print "not ok 2\n";}
53 @keys = ('blurfl', keys(%h), 'dyick');
54 if ($#keys == 31) {print "ok 3\n";} else {print "not ok 3\n";}
56 $size = ((split('/',scalar %h))[1]);
58 $newsize = ((split('/',scalar %h))[1]);
59 if ($newsize == $size * 8) {print "ok 4\n";} else {print "not ok 4\n";}
61 $size = ((split('/',scalar %h))[1]);
62 if ($size == $newsize) {print "ok 5\n";} else {print "not ok 5\n";}
64 $size = ((split('/',scalar %h))[1]);
65 if ($size == $newsize) {print "ok 6\n";} else {print "not ok 6\n";}
68 $size = ((split('/',scalar %h))[1]);
69 if ($size == 8) {print "ok 7\n";} else {print "not ok 7\n";}
74 $total += $key while $key = each %hash;
75 print "# Scalar each is bad.\nnot " unless $total == 100;
78 for (1..3) { @foo = each %hash }
81 $total += $key while $key = each %hash;
82 print "# Scalar keys isn't resetting the iterator.\nnot " if $total != 100;
85 for (1..3) { @foo = each %hash }
87 $total += $key while $key = each %hash;
88 print "# Iterator of each isn't being maintained.\nnot " if $total == 100;
91 for (1..3) { @foo = each %hash }
94 $total += $key while $key = each %hash;
95 print "# Scalar values isn't resetting the iterator.\nnot " if $total != 100;
98 $size = (split('/', scalar %hash))[1];
99 keys(%hash) = $size / 2;
100 print "not " if $size != (split('/', scalar %hash))[1];
102 keys(%hash) = $size + 100;
103 print "not " if $size == (split('/', scalar %hash))[1];
106 print "not " if keys(%hash) != 10;
109 print keys(hash) != 10 ? "not ok 15\n" : "ok 15\n";
112 %h = (a => A, b => B, c=> C, d => D, abc => ABC);
115 while (($key, $value) = each(h)) {
116 if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) {
120 if ($i == 5) { print "ok 16\n" } else { print "not ok\n" }
124 sub DESTROY { print "ok 18\n"; }
126 my $h = { A => bless [], __PACKAGE__ };
127 while (my($k,$v) = each %$h) {
128 print "ok 17\n" if $k eq 'A' and ref($v) eq 'Obj';