CPAN RT

The NIS interface comes in two parts.
The first part is the raw implementation of the NIS API,
described in Net::NIS.
The second is the object interface.
This document describes the object interface implementation.

The Table object represents an individual NIS map.
A NIS map is bound to a Table object with the new method:

$obj = Net::NIS::Table->new($map, [ $domain ]);

For example,

$hostsmap = Net::NIS::Table->new("hosts.byname");

This will create a Table object bound to the hosts.byname NIS map in the default NIS domain. All operations on the $hostsmap object will relate to the hosts.byname map.

You can also specify a non-default domain:

$hostsmap = Net::NIS::Table->new("hosts.byname", "my.domain.com.au");

Once a Table object has been bound to a NIS map, the following methods are available:

Returns the value for a given key. If you only wish to look up one or two values, this function is more efficient, as it retrieves the items one at a time. If you wish to retrieve many items (where many is dependent on the size of the map, and probably what sort of machine you are on), it is better to use the list interface, which uses just one RPC call to retreive the entire map.

Return a reference to an associative array which contains the entire NIS map. The keys in the %data array correspond to the keys in the NIS map. If any error occurs that prevents the retrieval of the map, then the undefined value is returned. In this case, your program can use the status method to determine the cause of the error.

Return a reference to an associative array which contains all entries that have keys that contain the $srchkey. If any error occurs that prevents the retrieval of the map, then the undefined value is returned. In this case, your program can use the status method to determine the cause of the error.

Returns the character representation of the status code for the last operation. If the last operation succeeded, then the status code is something like "operation succeeded". The exact strings returned by this function are implementation dependent, and should not be used for comparison purposes. Use the status call, as described above.

Copyright (c) 1995 Rik Harris (rik.harris@fulcrum.com.au). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The Network Information Service (NIS) was formerly known as Sun Yellow Pages (YP). The functionality of the two remains the same; only the name has changed. The name Yellow Pages is a registered trademark in the United Kingdom of British Telecommunications plc, and may not be used without permission.