/usr/lib/perl5/Search/Xapian/MSet.pm is in libsearch-xapian-perl 1.2.8.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | package Search::Xapian::MSet;
use 5.006;
use strict;
use warnings;
use Carp;
use Search::Xapian::MSet::Tied;
use Tie::Array;
require DynaLoader;
our @ISA = qw(Tie::Array DynaLoader);
# Preloaded methods go here.
# In a new thread, copy objects of this class to unblessed, undef values.
sub CLONE_SKIP { 1 }
use overload '=' => sub { $_[0]->clone() },
'fallback' => 1;
sub clone() {
my $self = shift;
my $class = ref( $self );
my $copy = new2( $self );
bless $copy, $class;
return $copy;
}
sub new() {
my $class = shift;
my $mset;
my $invalid_args;
if( scalar(@_) == 0 ) {
$mset = new1();
} elsif( scalar(@_) == 1 and ref( $_[1] ) eq $class ) {
$mset = new2(@_);
} else {
$invalid_args = 1;
}
if( $invalid_args ) {
Carp::carp( "USAGE: $class->new(), $class->new(\$mset)" );
exit;
}
bless $mset, $class;
return $mset;
}
sub fetch() {
my $self = shift;
my $invalid_args;
if( scalar(@_) == 2 ) {
$self->fetch1(@_);
} elsif( scalar(@_) == 1 ) {
$self->fetch2(@_);
} elsif( scalar(@_) == 0 ) {
$self->fetch3();
} else {
$invalid_args = 1;
}
if( $invalid_args ) {
Carp::carp( "USAGE: \$mset->fetch(\$begin, \$end), \$mset->fetch(\$msetiterator), \$mset->fetch()" );
exit;
}
}
sub convert_to_percent() {
my $self = shift;
my $invalid_args;
if( scalar(@_) == 1 ) {
my $arg = shift;
my $arg_class = ref $arg;
if( !$arg_class ) {
return $self->convert_to_percent1($arg);
} elsif( $arg_class eq 'Search::Xapian::MSetIterator' ) {
return $self->convert_to_percent2($arg);
} else {
$invalid_args = 1;
}
} else {
$invalid_args = 1;
}
if( $invalid_args ) {
Carp::carp( "USAGE: \$enquire->convert_to_percent(\$weight) or \$enquire->convert_to_percent(\$msetiterator)" );
exit;
}
}
sub items {
my $self = shift;
my @array;
tie( @array, 'Search::Xapian::MSet::Tied', $self );
return @array;
}
sub TIEARRAY {
my $class = shift;
my $eset = shift;
return bless $eset, $class;
}
1;
|