File Coverage

blib/lib/Monitoring/TT/Identifier.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 21 21 100.0


line stmt bran cond sub pod time code
1             package Monitoring::TT::Identifier;
2              
3 4     4   12 use strict qw{vars subs};
  4         7  
  4         109  
4 4     4   14 use warnings;
  4         5  
  4         68  
5 4     4   11 use utf8;
  4         5  
  4         18  
6              
7             #####################################################################
8              
9             =head1 NAME
10              
11             Monitoring::TT::Identifier - Identify Functions
12              
13             =head1 DESCRIPTION
14              
15             Helper to indentify functions of a module
16              
17             =cut
18              
19             #####################################################################
20              
21             =head1 METHODS
22              
23             =head2 functions
24              
25             functions(name)
26              
27             returns list of functions
28              
29             =cut
30              
31             sub functions {
32 3     3 1 4 my($name) = @_;
33             # Get all the CODE symbol table entries
34 63         157 my @functions = sort grep { /\A[^\W\d]\w*\z/mxso }
35 69         44 grep { defined &{"${name}::$_"} }
  69         111  
36 3         3 keys %{"${name}::"};
  3         25  
37 3         14 return \@functions;
38             }
39              
40             #####################################################################
41              
42             =head1 AUTHOR
43              
44             Sven Nierlein, 2013,
45              
46             =cut
47              
48             1;