line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Symbol::Approx::Sub::String::Approx |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Matcher plugin for Symbol::Approx::Sub; |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright (c) 2000, Magnum Solutions Ltd. All rights reserved. |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# This module is free software; you can redistribute it and/or |
9
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
package Symbol::Approx::Sub::String::Approx; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
require 5.006_000; |
15
|
1
|
|
|
1
|
|
529
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
16
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
65
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our ($VERSION, @ISA, $AUTOLOAD); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$VERSION = '3.1.1'; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
8
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
68
|
|
23
|
1
|
|
|
1
|
|
577
|
use String::Approx 'amatch'; |
|
1
|
|
|
|
|
4463
|
|
|
1
|
|
|
|
|
133
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Symbol::Approx::Sub::String::Approx |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
See L |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 match |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Passed a value and a list of values. Returns the values from the list |
38
|
|
|
|
|
|
|
which match the initial value using the C method from |
39
|
|
|
|
|
|
|
L. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub match { |
44
|
3
|
|
|
3
|
1
|
20
|
my ($sub, @subs) = @_; |
45
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
10
|
my @ret = grep { amatch($sub, $subs[$_]) } 0 .. $#subs; |
|
96
|
|
|
|
|
2334
|
|
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
86
|
return @ret; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |