Prune devel/py-EnthoughtBase
[dports.git] / devel / p5-lexical-underscore / pkg-descr
1 Starting with Perl 5.10, it is possible to create a lexical version of the Perl
2 default variable $_. Certain Perl constructs like the given keyword
3 automatically use a lexical $_ rather than the global $_.
4
5 It is occasionallly useful for a sub to be able to access its caller's $_
6 variable regardless of whether it was lexical or not. The (_) sub prototype is
7 the official way to do so, however there are sometimes disadvantages to this; in
8 particular it can only appear as the final required argument in a prototype, and
9 there is no way of the sub differentiating between an explicitly passed argument
10 and $_.
11
12 The lexical::underscore function returns a scalar reference to either a lexical
13 $_ variable somewhere up the call stack (using PadWalker magic), or to the
14 global $_ if there was no lexical version.
15
16 Wrapping lexical::underscore in ${ ... } dereferences the scalar reference,
17 allowing you to access (and even assign to) it.
18
19 WWW: http://search.cpan.org/dist/lexical-underscore/