line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::DoubleMetaphone; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: DoubleMetaphone.pm,v 1.3 2001/06/16 08:43:23 maurice Exp $ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
3229
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
92
|
|
7
|
1
|
|
|
1
|
|
5
|
use vars qw( $VERSION @ISA @EXPORT_OK $AUTOLOAD ); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
304
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
require DynaLoader; |
11
|
|
|
|
|
|
|
require AutoLoader; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
@ISA = qw( Exporter DynaLoader ); |
14
|
|
|
|
|
|
|
@EXPORT_OK = qw( double_metaphone ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = '0.07'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub AUTOLOAD { |
19
|
|
|
|
|
|
|
# This AUTOLOAD is used to 'autoload' constants from the constant() |
20
|
|
|
|
|
|
|
# XS function. If a constant is not found then control is passed |
21
|
|
|
|
|
|
|
# to the AUTOLOAD in AutoLoader. |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
|
|
my $constname; |
24
|
0
|
|
|
|
|
|
($constname = $AUTOLOAD) =~ s/.*:://; |
25
|
0
|
0
|
|
|
|
|
croak "& not defined" if $constname eq 'constant'; |
26
|
0
|
0
|
|
|
|
|
my $val = constant($constname, @_ ? $_[0] : 0); |
27
|
0
|
0
|
|
|
|
|
if ($! != 0) { |
28
|
0
|
0
|
|
|
|
|
if ($! =~ /Invalid/) { |
29
|
0
|
|
|
|
|
|
$AutoLoader::AUTOLOAD = $AUTOLOAD; |
30
|
0
|
|
|
|
|
|
goto &AutoLoader::AUTOLOAD; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
else { |
33
|
0
|
|
|
|
|
|
croak "Your vendor has not defined DoubleMetaphone macro $constname"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
110
|
|
37
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub () { $val }; |
|
0
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
goto &$AUTOLOAD; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
bootstrap Text::DoubleMetaphone $VERSION; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |