line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::FastSearch; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5964
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
777
|
use Errno; |
|
1
|
|
|
|
|
1184
|
|
|
1
|
|
|
|
|
36
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
67
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
require DynaLoader; |
11
|
1
|
|
|
1
|
|
873
|
use AutoLoader; |
|
1
|
|
|
|
|
1387
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @ISA = qw(Exporter DynaLoader); |
14
|
|
|
|
|
|
|
our @EXPORT = qw(search_string search_file strindex); |
15
|
|
|
|
|
|
|
our $VERSION = '1.0'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub strindex { |
18
|
0
|
|
|
0
|
1
|
|
return Text::FastSearch::_strindex (@_); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub search_string { |
22
|
0
|
|
|
0
|
1
|
|
my $results_ref = Text::FastSearch::_search_string (@_); |
23
|
0
|
0
|
|
|
|
|
return (wantarray ? @{$results_ref} : $results_ref) if $results_ref; |
|
0
|
0
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
return undef; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub search_file { |
28
|
0
|
|
|
0
|
1
|
|
my $results_ref = Text::FastSearch::_search_file (@_); |
29
|
0
|
0
|
|
|
|
|
return (wantarray ? @{$results_ref} : $results_ref) if $results_ref; |
|
0
|
0
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return undef; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub AUTOLOAD { |
34
|
|
|
|
|
|
|
# This AUTOLOAD is used to 'autoload' constants from the constant() |
35
|
|
|
|
|
|
|
# XS function. If a constant is not found then control is passed |
36
|
|
|
|
|
|
|
# to the AUTOLOAD in AutoLoader. |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
|
|
my $constname; |
39
|
0
|
|
|
|
|
|
our $AUTOLOAD; |
40
|
0
|
|
|
|
|
|
($constname = $AUTOLOAD) =~ s/.*:://; |
41
|
0
|
0
|
|
|
|
|
croak "& not defined" if $constname eq 'constant'; |
42
|
0
|
0
|
|
|
|
|
my $val = constant($constname, @_ ? $_[0] : 0); |
43
|
0
|
0
|
|
|
|
|
if ($! != 0) { |
44
|
0
|
0
|
|
|
|
|
if ($!{EINVAL}) { |
45
|
0
|
|
|
|
|
|
$AutoLoader::AUTOLOAD = $AUTOLOAD; |
46
|
0
|
|
|
|
|
|
goto &AutoLoader::AUTOLOAD; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
else { |
49
|
0
|
|
|
|
|
|
croak "Your vendor has not defined Text::FastSearch macro $constname"; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
{ |
53
|
1
|
|
|
1
|
|
255
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
148
|
|
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Fixed between 5.005_53 and 5.005_61 |
55
|
0
|
0
|
|
|
|
|
if ($] >= 5.00561) { |
56
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub () { $val }; |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
else { |
59
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub { $val }; |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
goto &$AUTOLOAD; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
bootstrap Text::FastSearch $VERSION; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
__END__ |