diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2013-03-09 18:18:56 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2013-03-09 18:18:56 +0000 |
commit | 2a52f8d735e9da5c1b3b8d706242a7e03b87c94d (patch) | |
tree | 5a1b0816f6caf365eb0b742bdab7fc2f6b23d05f /devel/Makefile | |
parent | f7cc9217e78e8d0e31d9e9502cd1035339d347fb (diff) |
- Add p5-lexical-underscore 0.001
Starting with Perl 5.10, it is possible to create a lexical version of the Perl
default variable $_. Certain Perl constructs like the given keyword
automatically use a lexical $_ rather than the global $_.
It is occasionallly useful for a sub to be able to access its caller's $_
variable regardless of whether it was lexical or not. The (_) sub prototype is
the official way to do so, however there are sometimes disadvantages to this; in
particular it can only appear as the final required argument in a prototype, and
there is no way of the sub differentiating between an explicitly passed argument
and $_.
The lexical::underscore function returns a scalar reference to either a lexical
$_ variable somewhere up the call stack (using PadWalker magic), or to the
global $_ if there was no lexical version.
Wrapping lexical::underscore in ${ ... } dereferences the scalar reference,
allowing you to access (and even assign to) it.
WWW: http://search.cpan.org/dist/lexical-underscore/
Notes
Notes:
svn path=/head/; revision=313741
Diffstat (limited to 'devel/Makefile')
-rw-r--r-- | devel/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index cf5a8838d4b8..6d8cab0bf991 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -2951,6 +2951,7 @@ SUBDIR += p5-iCal-Parser SUBDIR += p5-indirect SUBDIR += p5-latest + SUBDIR += p5-lexical-underscore SUBDIR += p5-lib-abs SUBDIR += p5-libalarm SUBDIR += p5-libxml-enno |