develooper Front page | perl.perl5.porters | Postings from July 2018

Re: Allowing require to return false

Thread Previous | Thread Next
Karen Etheridge
July 26, 2018 05:21
Re: Allowing require to return false
Message ID:
On Wed, Jul 25, 2018 at 5:10 PM, Tomasz Konojacki <> wrote:

> but I think that, for consistency, require()
> should always return a true value on success.

‚ÄčI can't think of anything that would break if we no longer required a true
value at the end of the file scope.

I can, however, think of some modules that return clever values that might
break if require() didn't return that particular value.

For new modules, which don't return anything, we'd have to return
something. It could be 1, but why not make it "0 but true"? ;>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About