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
|
|
|
|
|
25
|
|
|
25
|
|
|
|
|
568
|
|
11
|
25
|
|
|
25
|
|
74
|
use warnings; |
|
25
|
|
|
|
|
22
|
|
|
25
|
|
|
|
|
1035
|
|
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
|
211
|
my ( $class, $from, @methods ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
25
|
|
|
25
|
|
77
|
no strict 'refs'; |
|
25
|
|
|
|
|
21
|
|
|
25
|
|
|
|
|
1739
|
|
38
|
|
|
|
|
|
|
|
39
|
97
|
|
|
|
|
170
|
foreach my $method (@methods) { |
40
|
607
|
|
|
|
|
385
|
*{"Filesys::POSIX::$method"} = *{"$from\::$method"}; |
|
607
|
|
|
|
|
1589
|
|
|
607
|
|
|
|
|
967
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
97
|
|
|
|
|
228
|
return; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |