1Sub::Name(3)          User Contributed Perl Documentation         Sub::Name(3)
2
3
4

NAME

6       Sub::Name - (Re)name a sub
7

VERSION

9       version 0.21
10

SYNOPSIS

12           use Sub::Name;
13
14           subname $name, $subref;
15
16           $subref = subname foo => sub { ... };
17

DESCRIPTION

19       This module has only one function, which is also exported by default:
20
21   subname NAME, CODEREF
22       Assigns a new name to referenced sub.  If package specification is
23       omitted in the name, then the current package is used.  The return
24       value is the sub.
25
26       The name is only used for informative routines (caller, Carp, etc).
27       You won't be able to actually invoke the sub by the given name.  To
28       allow that, you need to do glob-assignment yourself.
29
30       Note that for anonymous closures (subs that reference lexicals declared
31       outside the sub itself) you can name each instance of the closure
32       differently, which can be very useful for debugging.
33

SEE ALSO

35       ·   Sub::Identify - for getting information about subs
36
37       ·   Sub::Util - set_subname is another implementation of "subname"
38

SUPPORT

40       Bugs may be submitted through the RT bug tracker
41       <https://rt.cpan.org/Public/Dist/Display.html?Name=Sub-Name> (or
42       bug-Sub-Name@rt.cpan.org <mailto:bug-Sub-Name@rt.cpan.org>).
43
44       There is also an irc channel available for users of this distribution,
45       at "#toolchain" on "irc.perl.org" <irc://irc.perl.org/#toolchain>.
46

AUTHOR

48       Matthijs van Duin <xmath@cpan.org>
49

CONTRIBUTORS

51       ·   Karen Etheridge <ether@cpan.org>
52
53       ·   Leon Timmermans <fawaka@gmail.com>
54
55       ·   Florian Ragwitz <rafl@debian.org>
56
57       ·   Reini Urban <rurban@cpanel.net>
58
59       ·   Matthijs van Duin <xmath-no-spam@nospam.cpan.org>
60
61       ·   gfx <gfuji@cpan.org>
62
63       ·   Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
64
65       ·   Aristotle Pagaltzis <pagaltzis@gmx.de>
66
67       ·   J.R. Mash <jmash.code@gmail.com>
68
69       ·   Alexander Bluhm <alexander.bluhm@gmx.net>
70
72       This software is copyright (c) 2004, 2008 by Matthijs van Duin, all
73       rights reserved; copyright (c) 2014 cPanel Inc., all rights reserved.
74
75       This program is free software; you can redistribute it and/or modify it
76       under the same terms as Perl itself.
77
78
79
80perl v5.30.0                      2019-07-26                      Sub::Name(3)
Impressum