mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
perlfunc: document return behavior of require and module_true feature
This commit is contained in:
parent
8fd53b46c5
commit
966e97bd7e
1
.mailmap
1
.mailmap
@ -232,6 +232,7 @@ Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Dagfinn Ilmari Mannsåker (via RT)
|
||||
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> ilmari@vesla.ilmari.org <ilmari@vesla.ilmari.org>
|
||||
Damian Conway <damian@conway.org> Damian Conway <damian@cs.monash.edu.au>
|
||||
Dan Book <grinnz@grinnz.com> Dan <grinnz@grinnz.com>
|
||||
Dan Book <grinnz@grinnz.com> Grinnz <grinnz@grinnz.com>
|
||||
Dan Dascalescu <bigbang7@gmail.com> Dan Dascalescu <ddascalescu+github@gmail.com>
|
||||
Dan Faigin <unknown> Dan Faigin, Doug Landauer <unknown@longtimeago>
|
||||
Dan Jacobson <jidanni@jidanni.org> Dan Jacobson <jidanni@hoffa.dreamhost.com>
|
||||
|
||||
@ -7111,6 +7111,7 @@ would have semantics similar to the following:
|
||||
croak $@ ? "$@Compilation failed in require"
|
||||
: "Can't locate $filename: $!\n";
|
||||
}
|
||||
return 1 if $feature_module_true_enabled_in_file;
|
||||
if (!$result) {
|
||||
delete $INC{$filename};
|
||||
croak "$filename did not return true value";
|
||||
@ -7136,6 +7137,11 @@ affects the compilation unit within which the feature is used, and using
|
||||
it before requiring a module will not change the behavior of existing
|
||||
modules that do not themselves also use it.
|
||||
|
||||
In this usage, the (truthy) result of the required file will be returned,
|
||||
but this should not be relied upon as it will not be returned in subsequent
|
||||
C<require> calls on the same file or with the 'module_true' feature enabled.
|
||||
To run a file and retrieve its return value, use L<C<do>|/do EXPR>.
|
||||
|
||||
If EXPR is a bareword, C<require> assumes a F<.pm>
|
||||
extension and replaces C<::> with C</> in the filename for you,
|
||||
to make it easy to load standard modules. This form of loading of
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user