| blib/lib/say.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 15 | 19 | 78.9 |
| branch | 1 | 2 | 50.0 |
| condition | n/a | ||
| subroutine | 4 | 4 | 100.0 |
| pod | n/a | ||
| total | 20 | 25 | 80.0 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package say; | ||||||
| 2 | 4 | 4 | 439500 | use strict; | |||
| 4 | 7 | ||||||
| 4 | 154 | ||||||
| 3 | 4 | 4 | 19 | use warnings; | |||
| 4 | 10 | ||||||
| 4 | 510 | ||||||
| 4 | |||||||
| 5 | our $VERSION = '0.04'; | ||||||
| 6 | |||||||
| 7 | sub import { | ||||||
| 8 | 4 | 4 | 37 | my $class = shift; | |||
| 9 | |||||||
| 10 | 4 | 11 | my $caller = caller; | ||||
| 11 | |||||||
| 12 | 4 | 50 | 16 | if( $] < 5.010 ) { | |||
| 13 | 0 | 0 | require Perl6::Say; | ||||
| 14 | 0 | 0 | Perl6::Say->import; | ||||
| 15 | |||||||
| 16 | 4 | 4 | 30 | no strict 'refs'; ## no critic | |||
| 4 | 7 | ||||||
| 4 | 518 | ||||||
| 17 | 0 | 0 | *{$caller . '::say'} = \&Perl6::Say::say; | ||||
| 0 | 0 | ||||||
| 18 | } | ||||||
| 19 | else { | ||||||
| 20 | 4 | 20 | require feature; | ||||
| 21 | 4 | 10 | for my $f ('say', @_) { | ||||
| 22 | 6 | 5754 | feature->import($f); | ||||
| 23 | } | ||||||
| 24 | } | ||||||
| 25 | } | ||||||
| 26 | |||||||
| 27 | 1; | ||||||
| 28 | |||||||
| 29 | __END__ |