Browse files

Spec a useful return value for "require"

This is inspired by some repetitive code being written for File::Spec, see .
  • Loading branch information...
1 parent 22f12ce commit d46a8abe6b9b4988b1bd31d19fae88fb36144ab1 @sorear sorear committed Sep 14, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 S11-modules.pod
@@ -13,8 +13,8 @@ Synopsis 11: Modules
Created: 27 Oct 2004
- Last Modified: 04 Sep 2012
- Version: 37
+ Last Modified: 14 Sep 2012
+ Version: 38
=head1 Overview
@@ -280,6 +280,10 @@ This means something like:
exist; this differs from C<.import_alias>, which requires that the
imported symbols I<not> already exist in the target scope.)
+Additionally, the C<require> expression evaluates to the value which is
+installed as the alias, so that C<(require Foo::Bar).new> and similar
+expressions do the most useful thing.
Alternately, a filename may be mentioned directly, which installs a
package that is effectively anonymous to the current lexical scope,
and may only be accessed by whatever global names the module installs:

0 comments on commit d46a8ab

Please sign in to comment.