prepare for 0.07 release
[p5sagit/Sub-Name.git] / lib / Sub / Name.pm
CommitLineData
16c23894 1package Sub::Name;
2
3=head1 NAME
4
5Sub::Name - (re)name a sub
6
7=head1 SYNOPSIS
8
9 use Sub::Name;
10
11 subname $name, $subref;
12
13 $subref = subname foo => sub { ... };
14
15=head1 DESCRIPTION
16
d73d8321 17This module has only one function, which is also exported by default:
16c23894 18
19=head2 subname NAME, CODEREF
20
21Assigns a new name to referenced sub. If package specification is omitted in
22the name, then the current package is used. The return value is the sub.
23
24The name is only used for informative routines (caller, Carp, etc). You won't
25be able to actually invoke the sub by the given name. To allow that, you need
26to do glob-assignment yourself.
27
d73d8321 28Note that for anonymous closures (subs that reference lexicals declared outside
29the sub itself) you can name each instance of the closure differently, which
30can be very useful for debugging.
16c23894 31
32=head1 AUTHOR
33
34Matthijs van Duin <xmath@cpan.org>
35
979516cc 36Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
24f50a79 37Copyright (C) 2014 cPanel Inc. All rights reserved.
16c23894 38This program is free software; you can redistribute it and/or modify
39it under the same terms as Perl itself.
40
41=cut
42
43use 5.006;
44
45use strict;
46use warnings;
47
988a6b12 48our $VERSION = '0.07';
16c23894 49
50use base 'Exporter';
51use base 'DynaLoader';
52
53our @EXPORT = qw(subname);
54our @EXPORT_OK = @EXPORT;
55
56bootstrap Sub::Name $VERSION;
57
581;