File Coverage

blib/lib/App/Greple/Common.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package App::Greple::Common;
2              
3 135     135   3076 use v5.24;
  135         515  
4 135     135   736 use warnings;
  135         298  
  135         8927  
5              
6             =encoding utf-8
7              
8             =head1 NAME
9              
10             App::Greple::Common - interface for common resources
11              
12             =head1 SYNOPSIS
13              
14             use App::Greple::Common qw(@color_list)
15              
16             =head1 DESCRIPTION
17              
18             This module provides interface to access L common
19             resources which can be accessed from the external modules.
20              
21             Historically, only C<&FILELABEL> is exported when used without
22             arguments. Note that when used with arguments, only the specified
23             elements are exported.
24              
25             =head1 EXPORTED VARIABLES
26              
27             =head2 CONSTANTS
28              
29             =over 7
30              
31             =item C<&FILELABEL>
32              
33             A label corresponding to the filename passed in the
34             L interface.
35              
36             =back
37              
38             =head2 VARIABLES
39              
40             =over 7
41              
42             =item C<%color_list>
43              
44             Indexed color pallet.
45              
46             =item C<%color_hash>
47              
48             Labeled color table.
49              
50             =item C<%debug>
51              
52             Debug flag.
53              
54             =back
55              
56             =head1 AUTHOR
57              
58             Kazumasa Utashiro
59              
60             =head1 LICENSE
61              
62             Copyright ©︎ 1991-2026 Kazumasa Utashiro.
63              
64             This library is free software; you can redistribute it and/or modify
65             it under the same terms as Perl itself.
66              
67             =cut
68              
69 135     135   801 use Exporter 'import';
  135         271  
  135         10176  
70             our @EXPORT = ();
71             our %EXPORT_TAGS = ();
72             our @EXPORT_OK = qw();
73              
74 135     135   811 use constant FILELABEL => '__file__';
  135         284  
  135         26120  
75             push @EXPORT, qw(FILELABEL);
76              
77             *debug = \%::opt_d; push @EXPORT_OK, qw(%debug);
78             *color_list = \@::colors; push @EXPORT_OK, qw(@color_list);
79             *color_hash = \%::colormap; push @EXPORT_OK, qw(%color_hash);
80              
81             *setopt = \&::setopt; push @EXPORT_OK, qw(setopt);
82             *newopt = \&::newopt; push @EXPORT_OK, qw(newopt);
83              
84             1;