line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package List::Member;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.005_62;
|
4
|
1
|
|
|
1
|
|
1540
|
use strict;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
58
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
6
|
1
|
|
|
1
|
|
26
|
use Carp ();
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
335
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter;
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(&member ¬a_member);
|
11
|
|
|
|
|
|
|
our $VERSION = '0.044';
|
12
|
|
|
|
|
|
|
our $NEG = -1;
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
0
|
5
|
sub nota_member { return $NEG }
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub member {
|
17
|
6
|
|
|
6
|
0
|
542
|
my $target = shift;
|
18
|
6
|
50
|
|
|
|
16
|
Carp::croak 'No target in member/2 ' unless defined $target;
|
19
|
6
|
100
|
|
|
|
13
|
if (ref $target eq 'Regexp'){
|
20
|
1
|
|
|
|
|
4
|
for (0..$#_){
|
21
|
1
|
50
|
|
|
|
11
|
return $_ if $_[$_] =~ $target;
|
22
|
|
|
|
|
|
|
}
|
23
|
|
|
|
|
|
|
} else {
|
24
|
5
|
|
|
|
|
12
|
for (0..$#_){
|
25
|
13
|
100
|
|
|
|
44
|
return $_ if $_[$_] eq $target;
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
}
|
28
|
1
|
|
|
|
|
3
|
return $NEG;
|
29
|
|
|
|
|
|
|
}
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1;
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__
|