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

Re: Question/suggestion on perlfunc.pod example

Thread Previous | Thread Next
Eric Brine
June 21, 2015 05:27
Re: Question/suggestion on perlfunc.pod example
Message ID:
On Fri, Jun 19, 2015 at 7:53 PM, Aristotle Pagaltzis <>

> 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

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