1NAME 2 3Lexical::Import - clean imports from package-exporting modules 4 5DESCRIPTION 6 7This module allows functions and other items, from a separate module, to 8be imported into the lexical namespace (as implemented by Lexical::Var), 9when the exporting module exports non-lexically to a package in the 10traditional manner. This is a translation layer, to help code written 11in the new way to use modules written in the old way. 12 13A lexically-imported item takes effect from the end of the definition 14statement up to the end of the immediately enclosing block, except 15where it is shadowed within a nested block. This is the same lexical 16scoping that the "my", "our", and "state" keywords supply. Within its 17scope, any use of the single-part name of the item (e.g., "$foo") 18refers directly to that item, regardless of what is in any package. 19Explicitly package-qualified names (e.g., "$main::foo") still refer to 20the package. There is no conflict between a lexical name definition 21and the same name in any package. 22 23This mechanism only works on Perl 5.11.2 and later. Prior to that, 24it is impossible for lexical subroutine imports to work for bareword 25subroutine calls. (See "BUGS" in Lexical::Var for details.) Other kinds 26of lexical importing are possible on earlier Perls, but because this is 27such a critical kind of usage in most code, this module will ensure that 28it works, for convenience. If the limited lexical importing is desired 29on earlier Perls, use Lexical::Var directly. 30 31INSTALLATION 32 33 perl Build.PL 34 ./Build 35 ./Build test 36 ./Build install 37 38AUTHOR 39 40Andrew Main (Zefram) <zefram@fysh.org> 41 42COPYRIGHT 43 44Copyright (C) 2010, 2011 Andrew Main (Zefram) <zefram@fysh.org> 45 46LICENSE 47 48This module is free software; you can redistribute it and/or modify it 49under the same terms as Perl itself. 50