Here is some actual working code from SetDB 0.2:use strict;
use DBI;
use SetDB;
no strict 'subs';
my $dbi = DBI->connect(
'DBI:mysql:database=setdb_test;host=localhost', 'setdb', 'setdb');
use vars qw( $schema );
do 'schema.pl';
my $db = new SetDB($dbi, $schema);
my $people = $db->newSet(person, book);
while(my $person = $people->fetchNext())
{
print "Name: $person->{name}\n";
my $books = $person->{book};
while(my $book = $books->fetchNext())
{
print " Book: $book->{title}\n";
# Demonstrate updates by adding ' sucks!' to the book's title
$book->{title} .= ' sucks!';
}
}