| 1 | package Lingua::Pangram; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use locale; # for correct lowercasing of 8-bit chars | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | require Exporter; | |||||||||||
| 8 | |||||||||||||
| 9 | 1 | @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 | 1 | @EXPORT = qw( ); | |||||||||||
| 14 | 1 | $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 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 22 | 2 | my $class = shift; | |||||||||||
| 23 | 2 | ▶ | my $alphabet = shift || [ 'a' .. 'z' ]; | ||||||||||
|
Condition100%2/2
shift() || [('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')]
MC/DC100%1/1
shift() || [('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')]
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||
| 24 | 2 | my $self = bless $alphabet, $class; | |||||||||||
| 25 | 2 | return $self; | |||||||||||
| 26 | }#new | ||||||||||||
| 27 | |||||||||||||
| 28 | |||||||||||||
| 29 | 4 | ▶ | sub pangram { | ||||||||||
|
Subroutine
pangram: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||
| 30 | 4 | my $self = shift; | |||||||||||
| 31 | 4 | my $string = lc shift; | |||||||||||
| 32 | |||||||||||||
| 33 | 4 | my $ret = 1; | |||||||||||
| 34 | 4 | foreach my $letter (@$self) { | |||||||||||
| 35 | 108 | ▶ | $ret = 0 if index($string, $letter) == -1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 4 | return $ret; | |||||||||||
| 39 | }#pangram | ||||||||||||
| 40 | |||||||||||||
| 41 | 1 | 1; | |||||||||||
| 42 | __END__ | ||||||||||||