blob: 5a445ed5d6f08b59521f2bca59ab8e6cef520ad2 (
plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!./perl
# $Header: op.each,v 2.0 88/06/05 00:13:38 root Exp $
print "1..3\n";
$h{'abc'} = 'ABC';
$h{'def'} = 'DEF';
$h{'jkl'} = 'JKL';
$h{'xyz'} = 'XYZ';
$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';
@keys = keys(h);
@values = values(h);
if ($#keys == 29 && $#values == 29) {print "ok 1\n";} else {print "not ok 1\n";}
while (($key,$value) = each(h)) {
if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) {
$key =~ y/a-z/A-Z/;
$i++ if $key eq $value;
}
}
if ($i == 30) {print "ok 2\n";} else {print "not ok 2\n";}
@keys = ('blurfl', keys(h), 'dyick');
if ($#keys == 31) {print "ok 3\n";} else {print "not ok 3\n";}
|