--- trunk/PlusPlus.pm 2004/12/05 00:59:50 9 +++ trunk/PlusPlus.pm 2004/12/05 12:48:00 10 @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.03'; +our $VERSION = '0.04'; use Carp; use File::Temp qw/ tempdir /; @@ -31,11 +31,11 @@ =head1 METHODS -=head2 open +=head2 new Create new indexing object. - my $i = SWISH::PlusPlus->open( + my $i = SWISH::PlusPlus->new( index_dir => '/path/to/index', index => 'index++', search => 'search++', @@ -44,7 +44,7 @@ use_stopwords => 1, ); -Options to open are following: +Options to new are following: =over 5 @@ -81,7 +81,7 @@ =cut -sub open { +sub new { my $class = shift; my $self = {@_}; bless($self, $class); @@ -98,7 +98,7 @@ $self->{'index'} ||= 'index'; $self->{'search'} ||= 'search'; - print STDERR "## open index_dir: ",$self->{'index_dir'}," index: ",$self->{'index'}, " search: ",$self->{'search'},"\n" if ($self->{'debug'}); + print STDERR "## new index_dir: ",$self->{'index_dir'}," index: ",$self->{'index'}, " search: ",$self->{'search'},"\n" if ($self->{'debug'}); $self ? return $self : return undef; } @@ -106,7 +106,7 @@ =head2 check_bin -Check if swish++ binaries specified in L are available and verify +Check if swish++ binaries specified in L are available and verify version signature. if ($i->check_bin) { @@ -218,7 +218,7 @@ my $open_cmd = $self->{'search'}." -i ".$self->{'index_dir'}.'/index "'.$query.'" |'; print STDERR "## search $open_cmd\n" if ($self->{'debug'}); - CORE::open(SEARCH, $open_cmd) || confess "can't start $open_cmd: $!"; + open(SEARCH, $open_cmd) || confess "can't start $open_cmd: $!"; while() { next if (/^#/); chomp; @@ -266,7 +266,7 @@ my $opt = "-v 4"; unless ($self->{'use_stopwrods'}) { - CORE::open(STOP, '>', "_stopwords_") || carp "can't create empty stopword file, skipping\n"; + open(STOP, '>', "_stopwords_") || carp "can't create empty stopword file, skipping\n"; print STOP " "; close(STOP); $opt .= " -s _stopwords_"; @@ -275,7 +275,7 @@ my $open_cmd = '| '.$self->{'index'}.' '.$opt.' -e "html:*" -i '.$self->{'index_dir'}.'/index -'; - CORE::open($self->{'index_fh'}, $open_cmd) || confess "can't start index with $open_cmd: $!"; + open($self->{'index_fh'}, $open_cmd) || confess "can't start index with $open_cmd: $!"; return $self->{'index_fh'}; @@ -309,7 +309,7 @@ my $path = $self->{'tmp_dir'} || confess "no tmp_dir?"; - CORE::open(TMP, '>', $arg->{'path'}) || die "can't create temp file ".$arg->{'path'}.": $!"; + open(TMP, '>', $arg->{'path'}) || die "can't create temp file ".$arg->{'path'}.": $!"; print TMP ''; @@ -366,7 +366,7 @@ Debian version of swish++ is often old (version 5 at moment of this writing while version 6 is available in source code), so this module by default uses executable names B and B for self-compiled version -instead of one from Debian package. See L how to specify Debian +instead of one from Debian package. See L how to specify Debian default binaries B and B. =head2 SWISH++