POSIX/Module.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 95.2% 20 / 21 CC 2 SCAR 3.4
CC
2
Cov
100%
export_methods
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« POSIX/Inode.pm ↑ Summary POSIX/Directory/Handle.pm »
1 # Copyright (c) 2014, cPanel, Inc.
2 # All rights reserved.
3 # http://cpanel.net/
4 #
5 # This is free software; you can redistribute it and/or modify it under the same
6 # terms as Perl itself. See the LICENSE file for further details.
7  
8 package Filesys::POSIX::Module;
9  
10 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 NAME
14  
15 Filesys::POSIX::Module - Export methods to Filesys::POSIX namespace
16  
17 =head1 SYNOPSIS
18  
19 package Foo;
20  
21 use Filesys::POSIX::Module;
22  
23 my @METHODS = qw(foo bar baz);
24  
25 Filesys::POSIX::Module->export_methods(__PACKAGE__, @methods);
26  
27 =head1 DESCRIPTION
28  
29 C<Filesys::POSIX::Module> is used to extend C<L<Filesys::POSIX>> by allowing
30 callers to export methods from their own packages into C<L<Filesys::POSIX>>.
31  
32 =cut
33  
34 97 ▶sub export_methods {
Subroutine export_methods: called CC=2 SCAR=6.9
Pod undocumented
35 97 my ( $class, $from, @methods ) = @_;
36  
37 25 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 97 foreach my $method (@methods) {
40 607 *{"Filesys::POSIX::$method"} = *{"$from\::$method"};
41 }
42  
43 97 return;
44 }
45  
46 25 1;
47  
48 __END__
« POSIX/Inode.pm ↑ Summary POSIX/Directory/Handle.pm »