blib/lib/latest.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 90.6% 29 / 32 CC 2 SCAR 2.4
CC
2
Cov
92%
BEGIN
2.1
unknown_feature_bundle
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary
1 package latest::feature;
2  
3 2 ▶BEGIN {
Subroutine BEGIN: called CC=2 SCAR=7.4
4 2 eval 'require feature';
5 2 ▶ if ( $@ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 2 2
6 0 eval 'sub import {}'; # NOP if we don't have feature
7 }
8 else {
9 2 our @ISA = qw( feature );
10 2 ▶ eval 'sub unknown_feature_bundle {}'; # Ignore unknown bundle errors
Subroutine unknown_feature_bundle: not called CC=1 SCAR=0.0
11 }
12 }
13  
14 package latest;
15  
16 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 =head1 NAME
23  
24 latest - Use the latest Perl features
25  
26 =head1 VERSION
27  
28 This document describes latest version 0.03
29  
30 =cut
31  
32 2 our $VERSION = '0.03';
33  
34 =head1 SYNOPSIS
35  
36 use latest;
37
38 =head1 DESCRIPTION
39  
40 The line
41  
42 use latest;
43  
44 is roughly equivalent to
45  
46 use strict;
47 use warnings;
48 use $];
49  
50 except that 'use $]' doesn't work.
51  
52 The main use case is to
53  
54 use latest;
55  
56 at the top of your tests to shake out any obscure problems that might
57 result from your code being used by a program that requires the latest
58 Perl version.
59  
60 =cut
61  
62 2 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
63 2 strict->import;
64 2 warnings->import;
65 2 ( my $v = version->new( $] )->normal ) =~ s/^v/:/;
66 2 latest::feature->import( $v );
67 }
68  
69 2 1;
70 __END__
↑ Summary