File Coverage

samples/1-methods/lib/Derived.pm
Criterion Covered Total %
statement 12 18 66.6
branch n/a
condition n/a
subroutine 4 7 57.1
pod 0 3 0.0
total 16 28 57.1


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2             package
3             Derived;
4              
5 2     2   1251 use strict;
  2         6  
  2         126  
6 2     2   13 use warnings;
  2         4  
  2         102  
7              
8 2     2   1340 use File::AddInc;
  2         5852  
  2         17  
9 2     2   625 use parent qw(Greetings_oo_modulino);
  2         6  
  2         19  
10              
11             unless (caller) {
12             my $self = __PACKAGE__->new(name => "world");
13              
14             my $cmd = shift @ARGV
15             or die "Usage: $0 COMMAND ARGS...\n";
16              
17             if (my $sub = $self->can("cmd_$cmd")) {
18             $sub->($self, @ARGV)
19             }
20             elsif ($sub = $self->can("$cmd")) {
21             print $self->$cmd(@ARGV), "\n";
22             }
23             else {
24             die "Unknown command: $cmd\n";
25             }
26             }
27              
28 0     0 0   sub good_morning { my $self = shift; join(" ", "Good morning" => $self->{name}, @_)}
  0            
29              
30 0     0 0   sub good_afternoon { my $self = shift; join(" ", "Good afternoon" => $self->{name}, @_)}
  0            
31              
32 0     0 0   sub good_evening { my $self = shift; join(" ", "Good evening" => $self->{name}, @_)}
  0            
33              
34             1;