2663ea9501
Lexical::Import allows functions and other items, from a separate module, to be imported into the lexical namespace (as implemented by Lexical::Var), when the exporting module exports non-lexically to a package in the traditional manner. This is a translation layer, to help code written in the new way to use modules written in the old way. A lexically-imported item takes effect from the end of the definition statement up to the end of the immediately enclosing block, except where it is shadowed within a nested block. This is the same lexical scoping that the my, our, and state keywords supply. Within its scope, any use of the single-part name of the item (e.g., "$foo") refers directly to that item, regardless of what is in any package. Explicitly package-qualified names (e.g., "$main::foo") still refer to the package. There is no conflict between a lexical name definition and the same name in any package. This mechanism only works on Perl 5.11.2 and later. Prior to that, it is impossible for lexical subroutine imports to work for bareword subroutine calls. (See "BUGS" in Lexical::Var for details.) Other kinds of lexical importing are possible on earlier Perls, but because this is such a critical kind of usage in most code, this module will ensure that it works, for convenience. If the limited lexical importing is desired on earlier Perls, use Lexical::Var directly. WWW: http://search.cpan.org/dist/Lexical-Import/
31 lines
945 B
Makefile
31 lines
945 B
Makefile
# New ports collection makefile for: p5-Lexical-Import
|
|
# Date created: 2012-02-07
|
|
# Whom: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= Lexical-Import
|
|
PORTVERSION= 0.002
|
|
CATEGORIES= devel perl5
|
|
MASTER_SITES= CPAN
|
|
PKGNAMEPREFIX= p5-
|
|
|
|
MAINTAINER= sunpoet@FreeBSD.org
|
|
COMMENT= Clean imports from package-exporting modules
|
|
|
|
BUILD_DEPENDS= p5-Lexical-Var>=0.006:${PORTSDIR}/devel/p5-Lexical-Var \
|
|
p5-Module-Runtime>=0.011:${PORTSDIR}/devel/p5-Module-Runtime \
|
|
p5-Params-Classify>=0:${PORTSDIR}/devel/p5-Params-Classify
|
|
RUN_DEPENDS= p5-Lexical-Var>=0.006:${PORTSDIR}/devel/p5-Lexical-Var \
|
|
p5-Module-Runtime>=0.011:${PORTSDIR}/devel/p5-Module-Runtime \
|
|
p5-Params-Classify>=0:${PORTSDIR}/devel/p5-Params-Classify
|
|
|
|
TEST_DEPENDS= p5-Test-Pod>=1:${PORTSDIR}/devel/p5-Test-Pod \
|
|
p5-Test-Pod-Coverage>=0:${PORTSDIR}/devel/p5-Test-Pod-Coverage
|
|
|
|
PERL_CONFIGURE= 5.12.0+
|
|
|
|
MAN3= Lexical::Import.3
|
|
|
|
.include <bsd.port.mk>
|