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
|
25
|
|
|
25
|
|
78
|
use strict; |
|
25
|
|
|
|
|
28
|
|
|
25
|
|
|
|
|
523
|
|
11
|
25
|
|
|
25
|
|
71
|
use warnings; |
|
25
|
|
|
|
|
28
|
|
|
25
|
|
|
|
|
1071
|
|
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
|
97
|
|
|
97
|
0
|
205
|
my ( $class, $from, @methods ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
25
|
|
|
25
|
|
81
|
no strict 'refs'; |
|
25
|
|
|
|
|
23
|
|
|
25
|
|
|
|
|
1785
|
|
38
|
|
|
|
|
|
|
|
39
|
97
|
|
|
|
|
170
|
foreach my $method (@methods) { |
40
|
607
|
|
|
|
|
381
|
*{"Filesys::POSIX::$method"} = *{"$from\::$method"}; |
|
607
|
|
|
|
|
1505
|
|
|
607
|
|
|
|
|
920
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
97
|
|
|
|
|
226
|
return; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |