9
9
10
10
## Abstract
11
11
12
- This RFC proposes a feature which, when used, causes the current Perl file to
13
- to yield a true value when ` require ` , eliminating the need for a "1" (or
14
- other true value) at the end of the file.
12
+ This RFC proposes a feature which, when used, eliminates the need to end a Perl
13
+ module with the conventional "1" or other true value.
15
14
16
15
## Motivation
17
16
@@ -27,17 +26,15 @@ side-effect.
27
26
28
27
## Specification
29
28
30
- use feature 'module_true';
29
+ First, a new ` feature ` is added:
31
30
32
- ** Note** : the feature name is not settled, ` yield_true ` , ` module_true ` , and
33
- ` module_is_true ` have all been suggested.
34
-
35
- Code using the above does not need to end in a true value when required.
31
+ ``` perl
32
+ use feature ' module_true' ;
33
+ ```
36
34
37
- If the module explicitly returns a false value, module loading will fail as it
38
- does now. If the module author wants the module to fail to load under certain
39
- conditions, they should use ` die ` or a similar mechanism with an appropriate
40
- error message rather than returning false.
35
+ Then, * whenever* a module is loaded with ` require ` (or an equivalent, like
36
+ ` use ` ), the "croak if false" test is skipped if the ` module_true ` feature was
37
+ in effect at the last statement executed in the required module.
41
38
42
39
## Backwards Compatibility
43
40
0 commit comments