Essence

IDF

Included libraries Package variables General documentation Methods

Package variables top
Globals (from use vars definitions)
%nidf
$current_dbmname
$DEFAULT_UNKNOWN_IDF
$IDFDIR
$DEFAULT_DBMNAME = "enidf"
Included modulestop
File::Spec
MEAD::MEAD
strict
Inherit top
Exporter
Synopsistop
No synopsis!
Descriptiontop
No description!
Methodstop
get_nidfNo descriptionCode
open_nidfNo descriptionCode

Methods description


Methods code

get_nidfdescriptiontopprevnext
sub get_nidf {
    my $word = shift;

    unless (defined $current_dbmname) {
	open_nidf($DEFAULT_DBMNAME);
    }
    
    if (defined $nidf{$word}) {
	return $nidf{$word};
    }
    
    return $DEFAULT_UNKNOWN_IDF;
}
open_nidfdescriptiontopprevnext
sub open_nidf {
    my $dbmname = shift || $DEFAULT_DBMNAME;

    $dbmname = File::Spec->rel2abs($dbmname, $IDFDIR);

    if ($current_dbmname && $current_dbmname eq $dbmname) {
	return 1;
    }

    unless (dbmopen %nidf, $dbmname, 0666) {
	die "Cannot open DBM $dbmname";
    }

    unless (scalar(keys(%nidf))) {
        die "Empty DBM $dbmname";
    }

    $current_dbmname = $dbmname;

    return 1;
}

General documentation

No general documentation available.