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 21:11
Subject:
Re: Question/suggestion on perlfunc.pod example
Message ID:
20150619211114.GA90755@plasmasturm.org
* Eric Brine <ikegami@adaelis.com> [2015-06-19 20:40]:
> The absence of a defined value is an error as far as `do` cares.

Factually incorrect:

    $ echo 'print "hi\n"; undef' > x
    $ perl -wE 'do "x"; say 0+$!; say length $@'
    hi
    0
    0

No warnings, no errors, and the code ran fine.

`do` does not care about the return value *at all* beyond returning it
to the caller.

We can keep going in circles in this subthread as long as you are wrong
about this fact, but that won’t change it.

* Eric Brine <ikegami@adaelis.com> [2015-06-19 20:40]:
> Are you saying we should recommend "0;" for do and "1;" for require?

No I’m not. I have no idea how that occurred to you.

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