Essence
IDF
Globals (from use vars definitions) |
%nidf |
$current_dbmname |
$DEFAULT_UNKNOWN_IDF |
$IDFDIR |
$DEFAULT_DBMNAME = "enidf" |
get_nidf | No description | Code |
open_nidf | No description | Code |
Methods description
Methods code
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;
}
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.