name2verse.pl

filter: Statementstmt 91.6% 11 / 12 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 83.3% 15 / 18 CC 1 SCAR 0.0
CC
1
Cov
81%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Lingua/EN/Namegame.pm ↑ Summary
1 #!/usr/local/bin/perl -w
2 ######################################################################
3 # Copyright 2002, Tim Maher. tim@teachmeperl.com All Rights Reserved #
4 ######################################################################
5 # name2verse.pl: Uses Lingua::EN::Namegame to make verse from name
6  
7 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶use Lingua::EN::Namegame;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # Default argument simplifies testing
12 4 ▶@ARGV or @ARGV=qw(krusty);
Branch: 1 branch
BranchTrueFalseTotal
@ARGV or @ARGV = "krusty" 4 0 4
13  
14 4 my $name = ($ARGV[0]);
15 4 my $verse = name2verse($ARGV[0]);
16  
17 4 ▶if (defined $verse) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $verse) { } 4 0 4
18 4 print "$verse\n\n";
19 }
20 else {
21 0 warn "Error creating verse for $name\n\n"; # this shouldn't happen
22 }
23  
« blib/lib/Lingua/EN/Namegame.pm ↑ Summary