Browse files

spec both ::() and :file() require forms

  • Loading branch information...
TimToady committed Sep 5, 2012
1 parent 1ccffdd commit 65c3a065922fabfd992d051d661e1795b7703e32
Showing with 17 additions and 2 deletions.
  1. +17 −2 S11-modules.pod
@@ -13,8 +13,8 @@ Synopsis 11: Modules
Created: 27 Oct 2004
- Last Modified: 15 Jun 2011
- Version: 36
+ Last Modified: 04 Sep 2012
+ Version: 37
=head1 Overview
@@ -312,6 +312,21 @@ to the package scope instead:
(Such a routine I<may> rebind existing lexicals, however.)
+When you pass a string, C<require> always assumes the string contains a filename.
+To specify both a module name and a filename, use a colonpair modifier:
+ require Sense:file("/home/non/") <common @horse>;
+At mininum, this will create the C<Sense> package at compile time,
+even if the C<require> never puts anything into it at run time.
+It is also possible to specify both module name and filename by
+strings, though in this case the compiler will have no idea what your
+module is actually going to be called.
+ my $sense = "Sense";
+ require ::($sense):file("/home/non/") <common @horse>;
=head1 Importing from a pseudo-package
You may also import symbols from the various pseudo-packages listed in S02.

0 comments on commit 65c3a06

Please sign in to comment.