The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CfgTie::TieGeneric -- A generic hash that automatically binds others

SYNOPSIS

This is an associative array that automatially ties other configuration hashes

DESCRIPTION

This is a tie to bring other ties together automatically so you, the busy programmer and/or system administrator, don't have to. The related Perl module is not loaded unless it is needed at runtime.

        my %gen;
        tie %gen, 'CfgTie::TieGeneric';

Primary, or well-known, keys

env

This refers directly to the ENV hash.

group
mail

This is a special key. It forms a hash, with subkeys. See below for more information

net

This is a special key. It forms a hash with additional subkeys. See below for more details.

user

This is a link to the TieUser module (CfgTie::TieUser).

Composite

Composite primary keys are just like absolute file paths. For example, if you wanted to do something like this:

        my %lusers = $gen{'user'};
        my $Favorite_User = $lusers{'mygirl'};

You could just do:

        my $Favorite_User = $gen{'/users/mygirl'};
others...

These are the things automatically included in. This will be described below.

Subkeys for mail

aliases

CfgTie::TieAliases

Subkeys for net

host

CfgTie::TieHost

service

CfgTie::TieServ

protocol

CfgTie::TieProto

addr

CfgTie::TieNet

How other ties are automatically bound

Other keys are automatically (if it all possible) brought in using the following procedure:

1. If it is something already linked to it, that thingy is automatically returned (of course).
2. If the key is simple, like AABot, we will try to use AABot; If that works we will tie it and return the results.
3. If the key is more complex, like /OS3/Config, we will try to see if OS3 is already tied (and try to tie it, like above, if not). If that works, we will just look up Config in that hash. If it does not work, we will try to use and tie OS3::Config, OS3::TieConfig, and OS3::ConfigTie. If any of those work, we return the results.
4. Otherwise, undef will be returned.

See Also

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

Author

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