Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 65c3a065922fabfd992d051d661e1795b7703e32 1 parent 1ccffdd
@TimToady TimToady authored
Showing with 17 additions and 2 deletions.
  1. +17 −2 S11-modules.pod
View
19 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/Sense.pm") <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/Sense.pm") <common @horse>;
+
=head1 Importing from a pseudo-package
You may also import symbols from the various pseudo-packages listed in S02.
Please sign in to comment.
Something went wrong with that request. Please try again.