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

Re: Question/suggestion on perlfunc.pod example

Thread Previous | Thread Next
Aristotle Pagaltzis
June 19, 2015 21:11
Re: Question/suggestion on perlfunc.pod example
Message ID:
* Eric Brine <> [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 $@'

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

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