[sword-devel] New Perl Sword Interface

Joachim Ansorg sword-devel@crosswire.org
Wed, 18 Jul 2001 11:50:20 +0200


Get the Sword sources and have a look at include/canon.h
There's all the information you need.

Joachim


> Well, I've written a library interface to Sword.  Right now I'm sure it
> works with 1.5.2 because I've tested it.  It links directly to the
> library for maximum speed.
>
> The package is attached.  The README has full docs.  Here is an example
> that prints out the KJV:
>
> use Sword;
> my $vi = new Sword::VerseIterator("KJV");
> do {
>         print $vi->get_key . " : " . $vi->get_verse . "\n";
> } while($vi->next);
>
>
> QUESTION
> --------
> I have some ideas for improving the interface, but for efficiency
> reasons, I'd like to know a few things ... is there a way to:
> - Get a list of books in a module
> - Get a list of chapters in a book
> - Get a list of verses in a chapter
>
> This could make the Perl interface even nicer for web sites that want to
> browse.
>
> --John