Sub-Name-0.15
[p5sagit/Sub-Name.git] / README.pod
1 =pod
2
3 =encoding UTF-8
4
5 =head1 NAME
6
7 Sub::Name - (re)name a sub
8
9 =head1 VERSION
10
11 version 0.15
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
46 L<Sub::Identify> - for getting information about subs
47
48 =item *
49
50 L<Sub::Util> - set_subname is another implementation of C<subname>
51
52 =back
53
54 =for stopwords cPanel
55
56 =head1 SUPPORT
57
58 Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Sub-Name>
59 (or L<bug-Sub-Name@rt.cpan.org|mailto:bug-Sub-Name@rt.cpan.org>).
60
61 There is also an irc channel available for users of this distribution, at
62 L<C<#toolchain> on C<irc.perl.org>|irc://irc.perl.org/#toolchain>.
63
64 =head1 AUTHOR
65
66 Matthijs van Duin <xmath@cpan.org>
67
68 =head1 CONTRIBUTORS
69
70 =for stopwords Karen Etheridge Florian Ragwitz Matthijs van Duin Reini Urban Dagfinn Ilmari MannsÃ¥ker gfx J.R. Mash
71
72 =over 4
73
74 =item *
75
76 Karen Etheridge <ether@cpan.org>
77
78 =item *
79
80 Florian Ragwitz <rafl@debian.org>
81
82 =item *
83
84 Matthijs van Duin <xmath-no-spam@nospam.cpan.org>
85
86 =item *
87
88 Reini Urban <rurban@cpanel.net>
89
90 =item *
91
92 Dagfinn Ilmari MannsÃ¥ker <ilmari@ilmari.org>
93
94 =item *
95
96 gfx <gfuji@cpan.org>
97
98 =item *
99
100 J.R. Mash <jmash.code@gmail.com>
101
102 =back
103
104 =head1 COPYRIGHT AND LICENSE
105
106 This software is copyright (c) 2004, 2008 by Matthijs van Duin, all rights reserved;
107 copyright (c) 2014 cPanel Inc., all rights reserved.
108
109 This program is free software; you can redistribute it and/or modify
110 it under the same terms as Perl itself.
111
112 =cut