Attribute::SubName - Naming anonymous subroutines via attributes
version 1.101420
use Attribute::SubName; my $coderef = sub :Name(foo) { print "got: $_\n"; }; print foo("hi");
This module provides an attribute :Name that you can use on anonymous subroutines to give them a name. This is useful as they will then show up with that name in stack traces (cf. Carp). The naming is done with Sub::Name. Additionally, the attribute also installs the newly named subroutine in the proper glob slot so you can refer to it by name.
:Name
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Attribute-SubName.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Attribute-SubName/.
The development version lives at http://github.com/hanekomu/Attribute-SubName/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <marcel@cpan.org>
This software is copyright (c) 2007 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Attribute::SubName, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attribute::SubName
CPAN shell
perl -MCPAN -e shell install Attribute::SubName
For more information on module installation, please visit the detailed CPAN module installation guide.