NAME

CfgTie::TieHost -- This accesses the hosts tables.

SYNOPSIS

This is an associative array that allows the hosts tables to be configured easily.

tie %host,'CfgTie::TieHost';

DESCRIPTION

This is a straightforward hash tie that allows us to access the host database sanely.

Ties

There are two ties available for programmers:

tie %host,'CfgTie::TieHost'

$host{$name} will return a hash reference of the named host information.

tie %host_addr,'CfgTie::TieHost_addr'

$host_addr{$addr} will return a hash reference for the specified host.

Structure of hash

Any given host entry has the following information assoicated with it:

Name

Host name

Aliases

Other names for this host

AddrType

The type of address

Length
Addrs

A list reference of addresses. You will need something like

($a,$b,$c,$d) = unpack('C4',$Addr);

to get the address out sanely.

Additionally, the programmer can set any other associated key, but this information will only be available to a running Perl script.

See Also

CfgTie::TieAliases, CfgTie::TieGeneric, CfgTie::TieGroup, CfgTie::TieMTab, CfgTie::TieNamed, CfgTie::TieNet, CfgTie::TiePh, CfgTie::TieProto, CfgTie::TieRCService, CfgTie::TieRsrc, CfgTie::TieServ, CfgTie::TieShadow, CfgTie::TieUser

host(5)

Caveats

The current version does cache some host information.

Author

Randall Maas (mailto:randym@acm.org, http://www.hamline.edu/~rcmaas/)