devel/p5-lexical-underscore 0.004 FreeBSD
Access lexical underscore of your caller
- System
- FreeBSD
- Repository
- FreeBSD ports
- Maintainer
- [email protected]
- License
- ART10, GPLv1+
- Categories
- devel, perl5
- Package size
- 11.8 KiB, 42.4 KiB installed
Description
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.
In the other systems
| System | Port | Version |
|---|---|---|
| FreeBSD | devel/p5-lexical-underscore | 0.004 |
| DragonFly | devel/p5-lexical-underscore | 0.004 |
| HardenedBSD | devel/p5-lexical-underscore | 0.004 |
| GhostBSD | devel/p5-lexical-underscore | 0.004 |
Install
Binary package:
pkg install p5-lexical-underscore
From the ports tree:
cd /usr/ports/devel/p5-lexical-underscore/ && make install clean
To depend on this port in another port's Makefile:
RUN_DEPENDS= p5-lexical-underscore>0:devel/p5-lexical-underscore
Packages
The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.
| Repository | aarch64 | amd64 | armv6 | armv7 | i386 |
|---|---|---|---|---|---|
| FreeBSD:14:latest | 0.004 | 0.004 | 0.004 | 0.004 | 0.004 |
| FreeBSD:14:quarterly | 0.004 | 0.004 | n/a | 0.004 | 0.004 |
| FreeBSD:15:latest | 0.004 | 0.004 | n/a | 0.004 | 0.004 |
| FreeBSD:15:quarterly | 0.004 | 0.004 | n/a | n/a | n/a |
| FreeBSD:16:latest | 0.004 | 0.004 | n/a | n/a | n/a |
| FreeBSD:16:quarterly | n/a | n/a | n/a | n/a | n/a |
Dependencies
As this port's Makefile names them.
Build 1
p5-PadWalker>=0: devel/p5-PadWalker
Runtime 1
p5-PadWalker>=0: devel/p5-PadWalker
The full lists below include those, and their dependencies in turn.
Build dependencies 2
Run dependencies 2
Configuration
No options to configure.
- USES
- perl5
- Service scripts
- none
Files
pkg-plist 2
- %%SITE_PERL%%/lexical/underscore.pm
- %%PERL5_MAN3%%/lexical::underscore.3.gz
distinfo 1
| File | Size | SHA256 |
|---|---|---|
| lexical-underscore-0.004.tar.gz | 14512 | 6bd5d1469e161e199a9bd7fdde957e04176c5707cb059597a23ca3e130fb1134 |
Master sites 1
- CPAN
Commit history 0
No commits in the history this site was built from.