each.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
print "1..19\n";
$h{'abc'} = 'ABC';
$h{'def'} = 'DEF';
$h{'jkl','mno'} = "JKL\034MNO";
$h{'a'} = 'A';
$h{'b'} = 'B';
$h{'c'} = 'C';
$h{'d'} = 'D';
$h{'e'} = 'E';
$h{'f'} = 'F';
$h{'g'} = 'G';
$h{'h'} = 'H';
$h{'i'} = 'I';
$h{'j'} = 'J';
$h{'k'} = 'K';
$h{'l'} = 'L';
$h{'m'} = 'M';
$h{'n'} = 'N';
$h{'o'} = 'O';
$h{'p'} = 'P';
$h{'q'} = 'Q';
$h{'r'} = 'R';
$h{'s'} = 'S';
$h{'t'} = 'T';
$h{'u'} = 'U';
$h{'v'} = 'V';
$h{'w'} = 'W';
$h{'x'} = 'X';
$h{'y'} = 'Y';
$h{'z'} = 'Z';
$i = 0; # stop -w complaints
}
}
if ($i == 30) {print "ok 2\n";} else {print "not ok 2\n";}
keys %h = 1;
%h = (1,1);
undef %h;
%h = (1,1);
# test scalar each
%hash = 1..20;
$total = 0;
print "ok 8\n";
keys %hash;
$total = 0;
print "ok 9\n";
$total = 0;
print "ok 10\n";
values %hash;
$total = 0;
print "ok 11\n";
print "ok 12\n";
print "ok 13\n";
print "ok 14\n";
$i = 0;
$i++;
}
}
if ($i == 5) { print "ok 16\n" } else { print "not ok\n" }
{
{
my $h = { A => bless [], __PACKAGE__ };
}
}
print "ok 19\n";
}