package Prefix;
+use IO::File;
use Carp;
use DXVars;
use DB_File;
sub load
{
if ($db) {
+ undef $db;
untie %pre;
%pre = ();
%prefix_loc = ();
sub store
{
my ($k, $l);
- my $fh = new FileHandle;
+ my $fh = new IO::File;
my $fn = "$main::data/prefix_data.pl";
confess "Prefix system not started" if !$db;
$fh->print("$str ],\n");
}
$fh->print(");\n");
- $fh->close;
+ undef $fh;
+ untie %pre;
}
# what you get is a list that looks like:-
# remove any /0-9 /P /A /M /MM /AM suffixes etc
if (@parts > 1) {
+ $p = $parts[0];
+ shift @parts if $p =~ /^(WEB|NET)$/o;
$p = $parts[$#parts];
- pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|Q\w+)$/o;
+ pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|WEB|NET|Q\w+)$/o;
$p = $parts[$#parts];
- pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|Q\w+)$/o;
+ pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|WEB|NET|Q\w+)$/o;
# can we resolve them by direct lookup
foreach $p (@parts) {