Index: t/XSParagraph.t =================================================================== --- t/XSParagraph.t (révision 6530) +++ t/XSParagraph.t (copie de travail) @@ -16,13 +16,16 @@ # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. -my $paragraph; -$paragraph = {'word' => 'hello world', 'end_sentence' => 0}; +use XSParagraph; -print STDERR "Perl: here 1\n"; -XSParagraph::set_state ($paragraph); -print STDERR "Perl: here 2\n"; -XSParagraph::get_state ($paragraph); -print STDERR "In Perl: word set is ", $paragraph->{'word'}, "\n"; -print STDERR "In Perl: end_sentence is ", $paragraph->{'end_sentence'}, "\n"; +#no strict 'refs'; +#my @methods = grep { defined &{$_} } keys %XSParagraph::; +#use strict 'refs'; +#print STDERR "METHODS: @methods\n"; +my $paragraph = XSParagraph::new(); + +my $text = $paragraph->add_text("Some text."); +$text .= $paragraph->end(); + +print STDERR "$text"; Index: XSParagraph.pm =================================================================== --- XSParagraph.pm (révision 6530) +++ XSParagraph.pm (copie de travail) @@ -105,6 +105,14 @@ goto FALLBACK; } +my $dlname = undef; +if ($TEXINFO_XS eq 'module') { + $dlname = "XSParagraph.so"; + push @DynaLoader::dl_library_path, "./blib/arch/auto/XSParagraph/"; + $TEXINFO_XS = 'debug'; + goto LOAD; +} + my ($libtool_dir, $libtool_archive) = _find_file("XSParagraph.la"); if (!$libtool_archive) { _fatal "XSParagraph: couldn't find Libtool archive file"; @@ -119,7 +127,6 @@ } # Look for the line in XSParagraph.la giving the name of the loadable object. -my $dlname = undef; while (my $line = <$fh>) { if ($line =~ /^\s*dlname\s*=\s*'([^']+)'\s$/) { $dlname = $1; @@ -135,6 +142,8 @@ push @DynaLoader::dl_library_path, $libtool_dir; push @DynaLoader::dl_library_path, "$libtool_dir/.libs"; +LOAD: + my $dlpath = DynaLoader::dl_findfile($dlname); if (!$dlpath) { _fatal "XSParagraph: couldn't find $dlname"; Index: Makefile.PL =================================================================== --- Makefile.PL (révision 6530) +++ Makefile.PL (copie de travail) @@ -4,17 +4,16 @@ # the contents of the Makefile that is written. WriteMakefile( NAME => 'XSParagraph', - VERSION_FROM => 'lib/XSParagraph.pm', # finds $VERSION + VERSION_FROM => 'XSParagraph.pm', # finds $VERSION PREREQ_PM => {}, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT_FROM => 'lib/XSParagraph.pm', # retrieve abstract from module - AUTHOR => 'A. U. Thor
') : ()), + (AUTHOR => 'Gavin Smith ') : ()), LIBS => [''], # e.g., '-lm' DEFINE => '', # e.g., '-DHAVE_SOMETHING' INC => '-I.', # e.g., '-I. -I/usr/include/other' # Un-comment this if you add C files to link with later: - # OBJECT => '$(O_FILES)', # link all the C files too - 'MYEXTLIB' => 'mylib/libxspara.a', + OBJECT => '$(O_FILES)', # link all the C files too + #'MYEXTLIB' => 'mylib/libxspara.a', ); sub MY::postable {