Next Lightweight Databases 98

Multiple Values

     $my_btree->{compare} = sub { lc $_[0] cmp lc $_[1] };
     %hash = (Red => 'apple', red => 'cherry', RED => 'strawberry',
             blUe => 'grape');
     print "$hash{blUe} $hash{red} $hash{Red} $hash{RED}\n";
     grape apple apple apple
     my $db = tied %hash;
     $k = $START = 'red';
     for ($fail = $db->seq($k, $v, R_CURSOR);
          ! $fail;
          $fail = $db->seq($k, $v, R_NEXT)) {
       print "$k: $v\n";
     }
     Red: apple
     Red: cherry
     Red: strawberry


Next Copyright © 2003 M. J. Dominus