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

Re: Question/suggestion on perlfunc.pod example

Thread Previous | Thread Next
From:
Eric Brine
Date:
June 21, 2015 05:27
Subject:
Re: Question/suggestion on perlfunc.pod example
Message ID:
CALJW-qH0tCEu47xSBhkfND=wb8vnLOf1xaka7qL8iyq_6riRHA@mail.gmail.com
On Fri, Jun 19, 2015 at 7:53 PM, Aristotle Pagaltzis <pagaltzis@gmx.de>
wrote:

> Because there is NO reliable way of figuring out whether `do` failed to
> find and read the file. Any failure that looks like `do` signalling an
> I/O error can equally well have come from the code inside the file. You
> have no way of telling apart whether a) the `do` failed to locate and
> read the file or b) `do` did its job successfully and ran the code but
> the code returned without a true value and left $! populated with some
> error completely unrelated to the `do`.
>

Yes, buggy code could lead to the wrong error message being displayed. But
at least it leads to an error message being displayed. Under the usage
pattern you now recommend, buggy code will instead fail silently. That's
bad.

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