perl 4.0 patch 26: patch #20, continued
[p5sagit/p5-mst-13.2.git] / atarist / test / gdbm
1 die "cant create dbmtest" unless dbmopen(%keys, "dbmtest", 0666);
2
3 print "Writing...\n";
4
5 foreach (0..100) {
6     $keys{"$_"} = $_;
7 }
8
9 print "Done\n";
10
11 dbmclose (%keys);
12
13 die "cant read dbmtest" unless dbmopen(%rkeys, "dbmtest", undef);
14
15 $i = 0;
16 print "Reading...\n";
17 while (($key, $val) = each %rkeys)
18 {
19   if ($keys{$key} != $val)
20   {
21      print 'Incorrect val ', $key, ' = ', $val, ' expecting ', $keys{$key}, "\n";
22      $i = $i + 1;
23   }
24 }
25 print "Done\n";
26 dbmclose (%keys);
27 print $i, " Error(s)\n";
28 unlink "dbmtest";