GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  STONE::CURSOR (3)

.ds Aq ’

NAME

Stone::Cursor - Traverse tags and values of a Stone

CONTENTS

SYNOPSIS



 use Boulder::Store;
$store = Boulder::Store->new(./soccer_teams);

 my $stone = $store->get(28);
 $cursor = $stone->cursor;
 while (my ($key,$value) = $cursor->each) {
   print "$value: Go Bluejays!\n" if $key eq State and $value eq Katonah;
 }



DESCRIPTION

Boulder::Cursor is a utility class that allows you to create one or more iterators across a Stone object. This is used for traversing large Stone objects in order to identify or modify portions of the record.

    CLASS METHODS

Boulder::Cursor->new($stone) Return a new Boulder::Cursor over the specified Stone object. This will return an error if the object is not a Stone or a descendent. This method is usually not called directly, but rather indirectly via the Stone cursor() method:



  my $cursor = $stone->cursor;



    OBJECT METHODS

$cursor->each() Iterate over the attached <B>StoneB>. Each iteration will return a two-valued list consisting of a tag path and a value. The tag path is of a form that can be used with <B>B>Stone::index()<B>B> (in fact, a cursor is used internally to implement the <B>B>Stone::dump()<B>B> method. When the end of the <B>StoneB> is reached, each() will return an empty list, after which it will start over again from the beginning. If you attempt to insert or delete from the stone while iterating over it, all attached cursors will reset to the beginnning.

For example:



        $cursor = $s->cursor;
        while (($key,$value) = $cursor->each) {
           print "$value: BOW WOW!\n" if $key=~/pet/;          
        }



$cursor->reset() This resets the cursor back to the beginning of the associated <B>StoneB>.

AUTHOR

Lincoln D. Stein <lstein@cshl.org>.

COPYRIGHT

Copyright 1997-1999, Cold Spring Harbor Laboratory, Cold Spring Harbor NY. This module can be used and distributed on the same terms as Perl itself.

SEE ALSO

Boulder, Stone

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 28: ’=item’ outside of any ’=over’
Around line 37: You forgot a ’=back’ before ’=head2’
Around line 39: ’=item’ outside of any ’=over’
Around line 62: You forgot a ’=back’ before ’=head1’
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 STONE::CURSOR (3) 1999-11-30

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.