Skip to content

Commit 00fac3d

Browse files
committed
Re-document importing into a hash
1 parent fe21b8b commit 00fac3d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Exporter/Tiny/Manual/Importing.pod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ C<export_lexically> is included in a stable release of Perl.
160160
If you install L<Lexical::Var>, then lexical imports should work on versions
161161
of Perl as old as 5.12.
162162

163+
=head2 Importing into a hash
164+
165+
Another way of avoiding polluting your namespace with imports is to import
166+
into a hash.
167+
168+
my %U;
169+
use MyUtils { into => \%U };
170+
171+
...
172+
$U{frobnicate}->(...);
173+
163174
=head2 Unimporting
164175

165176
You can unimport the functions that MyUtils added to your namespace:

0 commit comments

Comments
 (0)