develooper Front page | perl.perl5.porters | Postings from June 2015

Re: Question/suggestion on perlfunc.pod example

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
June 19, 2015 18:24
Subject:
Re: Question/suggestion on perlfunc.pod example
Message ID:
20150619182433.GA90222@plasmasturm.org
* Eric Brine <ikegami@adaelis.com> [2015-06-19 20:10]:
> * Aristotle Pagaltzis <pagaltzis@gmx.de> [2015-06-08 12:30]:
> > * Eric Brine <ikegami@adaelis.com> [2015-06-08 00:40]:
> > > The code used to fail on false just like require, but you changed
> > > it so now it just fails on undefined. Why? This seems error-prone
> > > to me.
> >
> > What is error-prone about not failing on a value that cannot come
> > from a failure?
>
> Not warning when it's known that "1;" isn't present is error-prone
> because changes to unrelated code could suddenly cause the do to start
> failing.

Failing how? An absence of a `1;` (or other true value) is not an error
as far as `do` cares. It’s not `require`. If you personally prefer to
think of it as though it were, that’s fine, but the documentation should
document what is actually there, not some more convenient fantasy.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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