develooper Front page | perl.perl5.porters | Postings from April 2022

Re: Pre-RFC: a `library` keyword

Thread Previous | Thread Next
From:
Salvador Fandiño
Date:
April 5, 2022 10:20
Subject:
Re: Pre-RFC: a `library` keyword
Message ID:
508cf898-2d92-76b8-a73e-a0a68768a040@gmail.com
On 1/4/22 17:27, Ovid via perl5-porters wrote:

>    2. A `use feature 'yield_true'` to avoid having to put "1;" at the end
>      of the file; with a future plan to include that by default in the
>      versioned feature bundles.

But why not to just lift the requirement for modules to return a true value?

"require" documentation says "The file must return true as the last 
statement to indicate successful execution of any initialization code".

But, well, has anybody ever returned a false value on purpose in order 
to signal a failed initialization? Why would you want to do that when 
you can just call "die" with a proper error message?

It looks to me that this feature was more of an implementation detail 
showing up than anything else.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About