File Coverage

blib/lib/Symbol/Approx/Sub/String/Equal.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 18 18 100.0


line stmt bran cond sub pod time code
1             #
2             # Symbol::Approx::Sub::String::Equal
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::Equal;
13              
14             require 5.006_000;
15 10     10   5439 use strict;
  10         24  
  10         319  
16 10     10   75 use warnings;
  10         27  
  10         618  
17              
18             our ($VERSION, @ISA, $AUTOLOAD);
19              
20             $VERSION = '3.1.3';
21              
22 10     10   65 use Carp;
  10         18  
  10         1312  
23              
24             =head1 NAME
25              
26             Symbol::Approx::Sub::String::Equal
27              
28             =head1 SYNOPSIS
29              
30             See L
31              
32             =head1 METHODS
33              
34             =head2 match
35              
36             Passed a value and a list of values. Returns the values from the list
37             which equal (by string comparison) the initial value.
38              
39             =cut
40              
41             sub match {
42 12     12 1 120 my ($sub, @subs) = @_;
43              
44 12         61 my @ret = grep { $sub eq $subs[$_] } 0 .. $#subs;
  294         512  
45              
46 12         61 return @ret;
47             }
48              
49             1;