From 4fcfb4266551771b302eb4d4a3fcf40c7bffada8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Jul 2013 17:15:21 -0400 Subject: more docs --- lib/Exporter/Lexical.pm | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/Exporter/Lexical.pm b/lib/Exporter/Lexical.pm index 633da52..48e4d72 100644 --- a/lib/Exporter/Lexical.pm +++ b/lib/Exporter/Lexical.pm @@ -55,6 +55,19 @@ sub import { } } +=func build_exporter(\%opts[, $caller]) + + my $import Exporter::Lexical::build_exporter({ + -exports => ['foo'], + }); + +This function just creates the method that it would install as your package's +C method, without actually installing it. This lets you write your own +import method that does whatever you want it to do, while still being able to +export from it. + +=cut + sub build_exporter { my ($opts, $caller) = @_; $caller //= caller; @@ -79,6 +92,14 @@ sub build_exporter { }; } +=func lexical_import($name, $sub) + +Installs C<$sub> as a lexical subroutine into the currently compiling lexical +scope. Throws an error if there is no currently compiling lexical scope (for +instance, if this is called at runtime). + +=cut + =head1 BUGS No known bugs. @@ -123,12 +144,6 @@ L =back -=begin Pod::Coverage - - lexical_import - -=end Pod::Coverage - =cut 1; -- cgit v1.2.3