File Coverage

blib/lib/App/hopen/Util.pm
Criterion Covered Total %
statement 21 21 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package App::hopen::Util;
2             our $VERSION = '0.000013'; # TRIAL
3              
4             # Docs {{{1
5              
6             =head1 NAME
7              
8             App::hopen::Util - general utilities for App::hopen
9              
10             =cut
11              
12 4     4   176873 use strict; use warnings;
  4     4   21  
  4         122  
  4         22  
  4         7  
  4         108  
13 4     4   21 use parent 'Exporter';
  4         8  
  4         35  
14             use vars::i {
15 4         37 '@EXPORT' => [qw(isMYH)],
16             '@EXPORT_OK' => [qw(MYH)]
17 4     4   729 };
  4         929  
18 4         33 use vars::i '%EXPORT_TAGS' => {
19             default => [@EXPORT],
20             all => [@EXPORT, @EXPORT_OK],
21 4     4   573 };
  4         16  
22              
23             =head1 CONSTANTS
24              
25             =head2 MYH
26              
27             The name C<MY.hopen.pl>, centralized here. Not exported by default.
28              
29             =cut
30              
31 4     4   374 use constant MYH => 'MY.hopen.pl';
  4         10  
  4         570  
32              
33             =head1 FUNCTIONS
34              
35             =head2 isMYH
36              
37             Returns truthy if the given argument is the name of a C<MY.hopen.pl> file.
38             See also L</MYH>.
39              
40             =cut
41              
42             sub isMYH {
43 27 100   27 1 527 my $name = @_ ? $_[0] : $_;
44 27         50 return ($name =~ /\b\Q@{[MYH]}\E$/)
  27         437  
45             } #isMYH()
46              
47             1;