/usr/lib/perl5/Net/NIS/Table.pm is in libnet-nis-perl 0.43-1build3.
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 | # $Id$
require Net::NIS;
package Net::NIS::Table;
sub new
{
my($pkg, $map, $domain) = @_;
my ($self) = {};
$domain = Net::NIS::yp_get_default_domain() if ! $domain;
$self->{'map'} = $map;
$self->{'domain'} = $domain;
bless $self;
}
sub list
{
my ($me) = shift;
my ($value);
($me->{'status'}, $value) = Net::NIS::yp_all($me->{'domain'}, $me->{'map'});
return $value;
}
sub match
{
my ($me, $key) = @_;
my ($value);
($me->{'status'}, $value) =
Net::NIS::yp_match($me->{'domain'}, $me->{'map'}, $key);
return $value;
}
sub search
{
my ($me, $srch) = @_;
my ($value, %ret);
($me->{'status'}, $value) = Net::NIS::yp_all($me->{'domain'}, $me->{'map'});
foreach (grep(/$srch/, keys %{$value})) { $ret{$_} = $value->{$_}; };
return \%ret;
}
sub status
{
my ($me) = shift;
$me->{'status'};
}
1;
__END__
|