line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::Pangram; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
24460
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
4
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
126
|
|
5
|
1
|
|
|
1
|
|
7
|
use locale; # for correct lowercasing of 8-bit chars |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
11
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
12
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
13
|
|
|
|
|
|
|
@EXPORT = qw( ); |
14
|
|
|
|
|
|
|
$VERSION = '0.02'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Preloaded methods go here. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
0
|
770
|
my $class = shift; |
23
|
2
|
|
100
|
|
|
21
|
my $alphabet = shift || [ 'a' .. 'z' ]; |
24
|
2
|
|
|
|
|
6
|
my $self = bless $alphabet, $class; |
25
|
2
|
|
|
|
|
5
|
return $self; |
26
|
|
|
|
|
|
|
}#new |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub pangram { |
30
|
4
|
|
|
4
|
0
|
2317
|
my $self = shift; |
31
|
4
|
|
|
|
|
13
|
my $string = lc shift; |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
5
|
my $ret = 1; |
34
|
4
|
|
|
|
|
11
|
foreach my $letter (@$self) { |
35
|
108
|
100
|
|
|
|
203
|
$ret = 0 if index($string, $letter) == -1; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
|
|
|
10
|
return $ret; |
39
|
|
|
|
|
|
|
}#pangram |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |