Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Package Foo; use strict; use warnings; use Exporter 'import'; our @ISA = qw[Exporter]; our @EXPORT_OK = qw[%env $env]; our %env = %ENV; our $env = \%ENV; 1;
perl -I. -MFoo=%env -le 'print scalar keys %env' 38 perl -I. -MFoo=$env -le 'print scalar keys %$env' 0 perl -I. -MFoo=$env -le 'print scalar keys %$Foo::env' 38
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to export hash references
by hippo (Archbishop) on Feb 14, 2020 at 12:05 UTC | |
by Anonymous Monk on Feb 14, 2020 at 12:32 UTC |