| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
;# Usage: |
|
2
|
|
|
|
|
|
|
;# %foo = (); |
|
3
|
|
|
|
|
|
|
;# &abbrev(*foo,LIST); |
|
4
|
|
|
|
|
|
|
;# ... |
|
5
|
|
|
|
|
|
|
;# $long = $foo{$short}; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# |
|
8
|
|
|
|
|
|
|
# This library is no longer being maintained, and is included for backward |
|
9
|
|
|
|
|
|
|
# compatibility with Perl 4 programs which may require it. |
|
10
|
|
|
|
|
|
|
# |
|
11
|
|
|
|
|
|
|
# In particular, this should not be used as an example of modern Perl |
|
12
|
|
|
|
|
|
|
# programming techniques. |
|
13
|
|
|
|
|
|
|
# |
|
14
|
|
|
|
|
|
|
# Suggested alternative: Text::Abbrev |
|
15
|
|
|
|
|
|
|
# |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
package abbrev; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub main'abbrev { |
|
20
|
1
|
|
|
1
|
|
394
|
local(*domain) = @_; |
|
21
|
1
|
|
|
|
|
3
|
shift(@_); |
|
22
|
1
|
|
|
|
|
3
|
@cmp = @_; |
|
23
|
1
|
|
|
|
|
3
|
foreach $name (@_) { |
|
24
|
6
|
|
|
|
|
18
|
@extra = split(//,$name); |
|
25
|
6
|
|
|
|
|
23
|
$abbrev = shift(@extra); |
|
26
|
6
|
|
|
|
|
8
|
$len = 1; |
|
27
|
6
|
|
|
|
|
9
|
foreach $cmp (@cmp) { |
|
28
|
36
|
100
|
|
|
|
67
|
next if $cmp eq $name; |
|
29
|
30
|
|
100
|
|
|
131
|
while (@extra && substr($cmp,0,$len) eq $abbrev) { |
|
30
|
7
|
|
|
|
|
10
|
$abbrev .= shift(@extra); |
|
31
|
7
|
|
|
|
|
27
|
++$len; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
} |
|
34
|
6
|
|
|
|
|
19
|
$domain{$abbrev} = $name; |
|
35
|
6
|
|
|
|
|
15
|
while ($#extra >= 0) { |
|
36
|
15
|
|
|
|
|
21
|
$abbrev .= shift(@extra); |
|
37
|
15
|
|
|
|
|
54
|
$domain{$abbrev} = $name; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |