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 8, 2015 10:25
Subject:
Re: Question/suggestion on perlfunc.pod example
Message ID:
20150608102538.GA48141@plasmasturm.org
* 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?

> Well, I don't know what you call "Manual error checking can be done this
> way" if not a suggestion.

Yes, checking for errors from `do`. Not errors from the code inside the
file. The documentation cannot say how to check for the latter because
it is up to the author of the code to decide what the code inside the
file is or is not expected to do, once it has been successfully found
and started running. What the documentation *can* say is how to check
for errors from `do`, and not merely as a suggestion either.

If you want the code inside the file to return a true value, by all
means go ahead and demand that. But that has nothing to do with `do`.

-- 
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