Index: Makefile
===================================================================
RCS file: /cvsroot/clucene/wrappers/perl/Makefile,v
retrieving revision 1.5
diff -u -w -r1.5 Makefile
--- Makefile	24 Apr 2004 21:43:47 -0000	1.5
+++ Makefile	24 Nov 2004 12:43:19 -0000
@@ -12,8 +12,8 @@
 LIBCL=-L$(LIBDIR) -lclucene
 INCCL=$(INCDIR)
 CFLAGS=$(INCCL)
-LDFLAGS=-lstdc++
-LIBCLUCENE=$(LIBDIR)/libclucene.so
+LDFLAGS=-lstdc++ -lswigpl
+LIBCLUCENE=-L$(LIBDIR) -lclucene
 LIBCLUCENE_CYGWIN=-L$(LIBDIR) -lclucene
 PERLCORE := $(shell ./check.pl -perl)
 #PERLCORE=/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE
@@ -26,30 +26,32 @@
 	LD_LIBRARY_PATH=$(LIBDIR) perl tlucene.pl
 
 # clucene_dll.cpp, clucene_dll.h copied from wrappers/dll
-clucene_dll.o: clucene_dll.cpp
-	c++ -c clucene_dll.cpp $(CFLAGS)
+clucene_dll.o: clucene_dll.cpp clucene_dll.h
+	c++ -g -c clucene_dll.cpp $(CFLAGS)
 
-clucene_dll.cpp: ../dll/clucene_dll.cpp
-	cp ../dll/clucene_dll.cpp .
+#clucene_dll.cpp: ../dll/clucene_dll.cpp
+#	cp ../dll/clucene_dll.cpp .
+
+clucene_dll.h: ../dll/clucene_dll.h
 	cp ../dll/clucene_dll.h .
 
 clucene_wrap.o: clucene.i clucene_perl.h
 	@perl check.pl
 	swig -perl clucene.i
 	mv CLuceneWrap.pm FulltextSearch/
-	${CC} -c clucene_wrap.c $(CFLAGS) -I${PERLCORE} -Dbool=char ${SWIGCFLAGS}
+	${CC} -c -g clucene_wrap.c $(CFLAGS) -I${PERLCORE} -Dbool=char ${SWIGCFLAGS}
 
 cygwin: clucene_dll.o clucene_wrap.o
 	${CC} ${LIBCLUCENE_CYGWIN} $(LDFLAGS) /usr/bin/cygperl5_8_2.dll /usr/bin/cygcrypt-0.dll clucene_dll.o clucene_wrap.o -o CLuceneWrap.so
 
 CLuceneWrap.so: clucene_dll.o clucene_wrap.o
-	${CC} -static $(LIBCLUCENE) clucene_dll.o clucene_wrap.o -o CLuceneWrap.so $(LDFLAGS)
+	${CC} -g -shared $(LIBCLUCENE) clucene_dll.o clucene_wrap.o -o CLuceneWrap.so $(LDFLAGS) -lperl
 
 clean:
-	rm -f t *.o clucene_dll.cpp clucene_dll.h clucene_wrap.* CLuceneWrap.* clucene_dll.so swig.ver
+	rm -f t *.o clucene_dll.h clucene_wrap.* CLuceneWrap.* clucene_dll.so swig.ver
 
 # old tests
 
 t: t.o clucene_dll.o
-	c++ -o t t.o clucene_dll.o $(LIBCL) $(LDFLAGS)
+	c++ -g -o t t.o clucene_dll.o $(LIBCL) $(LDFLAGS) -lperl
 
Index: clucene.i
===================================================================
RCS file: /cvsroot/clucene/wrappers/perl/clucene.i,v
retrieving revision 1.2
diff -u -w -r1.2 clucene.i
--- clucene.i	18 Apr 2004 04:52:20 -0000	1.2
+++ clucene.i	24 Nov 2004 12:43:19 -0000
@@ -52,7 +52,7 @@
 
 char * CL_Search_Info1(int resource)
 {
-	CL_SEARCH_INFO(resource, searchinfobuf, (sizeof searchinfobuf)-1);
+	CL_SEARCHINFO(resource, searchinfobuf, (sizeof searchinfobuf)-1);
 	return searchinfobuf;
 }
 
Index: clucene_perl.h
===================================================================
RCS file: /cvsroot/clucene/wrappers/perl/clucene_perl.h,v
retrieving revision 1.2
diff -u -w -r1.2 clucene_perl.h
--- clucene_perl.h	18 Apr 2004 04:52:20 -0000	1.2
+++ clucene_perl.h	24 Nov 2004 12:43:19 -0000
@@ -52,7 +52,7 @@
 	// Query search info
 void		CL_QUERY (int resource, char * qry, int qry_len);
 	// Get query string
-//void		CL_SEARCH_INFO (int resource, char * pl, int len);
+void		CL_SEARCHINFO (int resource, char * pl, int len);
 	// Get search hits
 int		CL_HITCOUNT (int resource);
 	// Retrieve next hit
Index: t.c
===================================================================
RCS file: /cvsroot/clucene/wrappers/perl/t.c,v
retrieving revision 1.2
diff -u -w -r1.2 t.c
--- t.c	18 Apr 2004 04:52:20 -0000	1.2
+++ t.c	24 Nov 2004 12:43:19 -0000
@@ -15,7 +15,7 @@
 // declarations for swig to generate perl wrapper
 
 	// Opens a new CLucene directory, returns a resource
-long		CL_OPEN (char * path, bool create = false);
+long		CL_OPEN (char * path, int create = 1);
 	// Closes a CLucene directory
 bool		CL_CLOSE (long resource);
 	// Optimizes a Clucene directory
@@ -102,7 +102,8 @@
 {
 	char *path = "./index";
 	long resource;
-	bool create = true;
+//	bool create = true;
+	int create = 1;
 	int rc;
 	char errmsg[256];
 	char bigbuf[2048];
@@ -113,7 +114,7 @@
 	char * doccnt = "some content"; // "some more content", "content for third document"};
 	
 	resource = CL_OPEN(path,create);
-	if (resource==NULL)
+	if (resource == 0)
 	{
 		CL_ERRSTRGLOBAL(errmsg,(sizeof errmsg)-1);
 		printf("Error: %s\n", errmsg);
Index: tlucene.pl
===================================================================
RCS file: /cvsroot/clucene/wrappers/perl/tlucene.pl,v
retrieving revision 1.1
diff -u -w -r1.1 tlucene.pl
--- tlucene.pl	13 Apr 2004 13:40:43 -0000	1.1
+++ tlucene.pl	24 Nov 2004 12:43:19 -0000
@@ -11,6 +11,8 @@
 use Carp;
 use Data::Dumper;
 
+use lib '.';
+
 use FulltextSearch::CLucene;
 
 {
@@ -29,7 +31,7 @@
 
 	multisearch($cl);
 
-	empty($cl);
+	#empty($cl);
 
 	exit(0);
 }
@@ -67,14 +69,20 @@
 	my $cl = shift;
 	print "loaddocs\n";
 	$cl->open( path => "./index", create => 1 );
-	$cl->new_document;
-	$cl->add_field( field => "ref", value => "doc1");
-	$cl->add_field( field => "cnt", value => "some content");
-	$cl->add_date ( field => "add_dt", value => time );
+
+	for (my $i = 1 ; $i <= 10; $i++) {
+
+		$cl->new_document or confess "can't create new document";
+		$cl->add_field( field => "ref", value => "doc$i") or confess "can't add ref";
+		my $text = "some ".("more " x ($i-1))."content";
+		$cl->add_field( field => "cnt", value => $text) or confess "can't add cnt";
+		$cl->add_date ( field => "add_dt", value => time - $i ) or confess "can't add date";
 	my $s = $cl->document_info;
-	print "Document to add: $s\n";
+		print "Document to add [$i]: $s - $text\n";
 	$cl->insert_document
 		or confess "Failed to insert_document";
+	}
+
 	$cl->close;
 }
 
