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

Re: Allowing require to return false

Thread Previous | Thread Next
From:
Karen Etheridge
Date:
July 26, 2018 05:21
Subject:
Re: Allowing require to return false
Message ID:
CAPJsHfCzTZ8GtxEWREJ47Lfx0Hn9uqYThU2daBN-6oJ62Yw2Yw@mail.gmail.com
On Wed, Jul 25, 2018 at 5:10 PM, Tomasz Konojacki <me@xenu.pl> 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


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