7 abbrev - create an abbreviation table from a list
17 Stores all unambiguous truncations of each element of LIST
18 as keys key in the associative array indicated by C<*hash>.
19 The values are the original list elements.
23 abbrev(*hash,qw("list edit send abort gripe"));
33 # $long = $foo{$short};
36 local(*domain) = shift;
40 @extra = split(//,$name);
41 $abbrev = shift(@extra);
44 next if $cmp eq $name;
45 while (substr($cmp,0,$len) eq $abbrev) {
46 $abbrev .= shift(@extra);
50 $domain{$abbrev} = $name;
52 $abbrev .= shift(@extra);
53 $domain{$abbrev} = $name;