line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
24
|
|
|
24
|
|
98
|
use strict; |
|
24
|
|
|
|
|
30
|
|
|
24
|
|
|
|
|
740
|
|
11
|
24
|
|
|
24
|
|
86
|
use warnings; |
|
24
|
|
|
|
|
25
|
|
|
24
|
|
|
|
|
1182
|
|
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 is used to extend C> by allowing |
30
|
|
|
|
|
|
|
callers to export methods from their own packages into C>. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub export_methods { |
35
|
93
|
|
|
93
|
0
|
212
|
my ( $class, $from, @methods ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
24
|
|
|
24
|
|
96
|
no strict 'refs'; |
|
24
|
|
|
|
|
770
|
|
|
24
|
|
|
|
|
1833
|
|
38
|
|
|
|
|
|
|
|
39
|
93
|
|
|
|
|
182
|
foreach my $method (@methods) { |
40
|
580
|
|
|
|
|
403
|
*{"Filesys::POSIX::$method"} = *{"$from\::$method"}; |
|
580
|
|
|
|
|
1662
|
|
|
580
|
|
|
|
|
977
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
93
|
|
|
|
|
248
|
return; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |