Sub::Name(3pm)

Sub::Name3pm

(re)name a sub

Usage

    use Sub::Name;
    subname $name, $subref;
    $subref = subname foo => sub { ... };

Version

version 0.28

Overview

This module has only one function, which is also exported by default:

subname NAME, CODEREF

Assigns a new name to referenced sub. If package specification is omitted in the name, then the current package is used. The return value is the sub.

The name is only used for informative routines (caller, Carp, etc). You won't be able to actually invoke the sub by the given name. To allow that, you need to do glob-assignment yourself.

Note that for anonymous closures (subs that reference lexicals declared outside the sub itself) you can name each instance of the closure differently, which can be very useful for debugging.

Support

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Sub-Name> (or [email protected] <mailto:[email protected]>).

There is also an irc channel available for users of this distribution, at "#toolchain" on "irc.perl.org" <irc://irc.perl.org/#toolchain>.

Contributors

•

Karen Etheridge <[email protected]>

•

Graham Knop <[email protected]>

•

Leon Timmermans <[email protected]>

•

Florian Ragwitz <[email protected]>

•

Reini Urban <[email protected]>

•

Matthijs van Duin <[email protected]>

•

Dagfinn Ilmari Mannsåker <[email protected]>

•

gfx <[email protected]>

•

Aristotle Pagaltzis <[email protected]>

•

Alexander Bluhm <[email protected]>

•

J.R. Mash <[email protected]>

Releases

11 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0–6.0
  3. 7
  4. 8
  5. 9
  6. 10
  7. 11
  8. 12
  9. 13
  10. Arch

Author

Matthijs van Duin <[email protected]>

From perl-sub-name 0.28-3 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.