Commit | Line | Data |
67523925 |
1 | =pod |
2 | |
3 | =encoding UTF-8 |
4 | |
5 | =head1 NAME |
6 | |
7 | Sub::Name - (re)name a sub |
8 | |
9 | =head1 VERSION |
10 | |
00d17844 |
11 | version 0.11 |
67523925 |
12 | |
13 | =head1 SYNOPSIS |
14 | |
15 | use Sub::Name; |
16 | |
17 | subname $name, $subref; |
18 | |
19 | $subref = subname foo => sub { ... }; |
20 | |
21 | =head1 DESCRIPTION |
22 | |
23 | This module has only one function, which is also exported by default: |
24 | |
25 | =for stopwords subname |
26 | |
27 | =head2 subname NAME, CODEREF |
28 | |
29 | Assigns a new name to referenced sub. If package specification is omitted in |
30 | the name, then the current package is used. The return value is the sub. |
31 | |
32 | The name is only used for informative routines (caller, Carp, etc). You won't |
33 | be able to actually invoke the sub by the given name. To allow that, you need |
34 | to do glob-assignment yourself. |
35 | |
36 | Note that for anonymous closures (subs that reference lexicals declared outside |
37 | the sub itself) you can name each instance of the closure differently, which |
38 | can be very useful for debugging. |
39 | |
40 | =head1 SEE ALSO |
41 | |
42 | =over 4 |
43 | |
44 | =item * |
45 | L<Sub::Identify> - for getting information about subs |
46 | |
47 | =back |
48 | |
49 | =for stopwords cPanel |
50 | |
51 | This software is copyright (c) 2004, 2008 by Matthijs van Duin, all rights reserved; |
52 | copyright (c) 2014 cPanel Inc., all rights reserved. |
53 | |
54 | This program is free software; you can redistribute it and/or modify |
55 | it under the same terms as Perl itself. |
56 | |
57 | =head1 AUTHOR |
58 | |
59 | Matthijs van Duin <xmath@cpan.org> |
60 | |
61 | =head1 CONTRIBUTORS |
62 | |
00d17844 |
63 | =for stopwords Karen Etheridge Florian Ragwitz Matthijs van Duin Reini Urban Dagfinn Ilmari Mannsåker gfx J.R. Mash |
67523925 |
64 | |
65 | =over 4 |
66 | |
67 | =item * |
68 | |
69 | Karen Etheridge <ether@cpan.org> |
70 | |
71 | =item * |
72 | |
73 | Florian Ragwitz <rafl@debian.org> |
74 | |
75 | =item * |
76 | |
77 | Matthijs van Duin <xmath-no-spam@nospam.cpan.org> |
78 | |
79 | =item * |
80 | |
81 | Reini Urban <rurban@cpanel.net> |
82 | |
83 | =item * |
84 | |
85 | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> |
86 | |
87 | =item * |
88 | |
89 | gfx <gfuji@cpan.org> |
90 | |
00d17844 |
91 | =item * |
92 | |
93 | J.R. Mash <jmash.code@gmail.com> |
94 | |
67523925 |
95 | =back |
96 | |
97 | =head1 COPYRIGHT AND LICENSE |
98 | |
99 | =cut |