File Coverage

lib/Data/Hopen/Base.pm
Criterion Covered Total %
statement 35 35 100.0
branch 2 2 100.0
condition n/a
subroutine 11 11 100.0
pod n/a
total 48 48 100.0


line stmt bran cond sub pod time code
1             # Data::Hopen::Base: common definitions for hopen.
2             # Thanks to David Farrell,
3             # https://www.perl.com/article/how-to-build-a-base-module/
4             # Copyright (c) 2018 Christopher White. All rights reserved.
5             # SPDX-License-Identifier: BSD-3-Clause
6              
7             package Data::Hopen::Base;
8 25     25   3429365 use parent 'Exporter';
  25         449  
  25         242  
9 25     25   2582 use Import::Into;
  25         3511  
  25         1358  
10              
11             our $VERSION = '0.000021';
12              
13             # Pragmas
14 25     25   507 use 5.014;
  25         92  
15 25     25   148 use feature ":5.14";
  25         110  
  25         4657  
16 25     25   190 use strict;
  25         58  
  25         783  
17 25     25   124 use warnings;
  25         50  
  25         1966  
18             require experimental;
19              
20             # Packages
21 25     25   949 use Data::Dumper;
  25         11003  
  25         1582  
22 25     25   226 use Carp;
  25         91  
  25         2357  
23              
24             # Definitions from this file
25             use constant {
26 25         5874 true => !!1,
27             false => !!0,
28 25     25   156 };
  25         49  
29              
30             our @EXPORT = qw(true false);
31             #our @EXPORT_OK = qw();
32             #our %EXPORT_TAGS = (
33             # default => [@EXPORT],
34             # all => [@EXPORT, @EXPORT_OK]
35             #);
36              
37             #DEBUG
38             BEGIN {
39 25 100   25   384 unless($SIG{'__DIE__'}) {
40 24         4285 $SIG{'__DIE__'} = sub { Carp::confess(@_) };
  66         27829  
41             }
42             #$Exporter::Verbose=1;
43             }
44              
45             sub import {
46 279     279   368765 my $target = caller;
47              
48             # Copy symbols listed in @EXPORT first, in case @_ gets trashed later.
49 279         24760 Data::Hopen::Base->export_to_level(1, @_);
50              
51             # Re-export pragmas
52 279         2617 feature->import::into($target, qw(:5.14));
53 279         102886 "$_"->import::into($target) foreach qw(strict warnings);
54              
55             # Re-export packages
56 279         130707 Data::Dumper->import::into($target);
57 279         68360 Carp->import::into($target, qw(carp croak confess));
58             } #import()
59              
60             1;
61             __END__