X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSub%2FName.pm;h=5109d5e120ad5f10e2836498304f062c59e6edb0;hb=d2e2a4b98d0b8648e7503b67dd483de81c901db6;hp=7213465ba924bc7c8a5c0862c56a4663bf6737e5;hpb=a0f015f538bfe3a5a1eda54ac0b00bdff973cdd4;p=p5sagit%2FSub-Name.git diff --git a/lib/Sub/Name.pm b/lib/Sub/Name.pm index 7213465..5109d5e 100644 --- a/lib/Sub/Name.pm +++ b/lib/Sub/Name.pm @@ -1,8 +1,7 @@ package Sub::Name; +# ABSTRACT: (re)name a sub -=head1 NAME - -Sub::Name - (re)name a sub +=pod =head1 SYNOPSIS @@ -16,6 +15,8 @@ Sub::Name - (re)name a sub This module has only one function, which is also exported by default: +=for stopwords subname + =head2 subname NAME, CODEREF Assigns a new name to referenced sub. If package specification is omitted in @@ -29,12 +30,22 @@ 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. -=head1 AUTHOR +=head1 SEE ALSO + +=over 4 + +=item * +L - for getting information about subs -Matthijs van Duin +=back + +=for stopwords cPanel + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2004, 2008 by Matthijs van Duin, all rights reserved; +copyright (c) 2014 cPanel Inc., all rights reserved. -Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved. -Copyright (C) 2014 cPanel Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -45,14 +56,17 @@ use 5.006; use strict; use warnings; -our $VERSION = '0.08'; - -use base 'Exporter'; -use base 'DynaLoader'; +use Exporter 5.57 'import'; our @EXPORT = qw(subname); our @EXPORT_OK = @EXPORT; -bootstrap Sub::Name $VERSION; +use XSLoader; +XSLoader::load( + __PACKAGE__, + exists $Sub::Name::{VERSION} + ? ${ $Sub::Name::{VERSION} } + : (), +); 1;