BSD Ports

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

SystemPortVersion
FreeBSDdevel/p5-lexical-underscore0.004
DragonFlydevel/p5-lexical-underscore0.004
HardenedBSDdevel/p5-lexical-underscore0.004
GhostBSDdevel/p5-lexical-underscore0.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.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest0.0040.0040.0040.0040.004
FreeBSD:14:quarterly0.0040.004n/a0.0040.004
FreeBSD:15:latest0.0040.004n/a0.0040.004
FreeBSD:15:quarterly0.0040.004n/an/an/a
FreeBSD:16:latest0.0040.004n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 1

Runtime 1

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
FileSizeSHA256
lexical-underscore-0.004.tar.gz145126bd5d1469e161e199a9bd7fdde957e04176c5707cb059597a23ca3e130fb1134
Master sites 1
  • CPAN

Commit history 0

No commits in the history this site was built from.