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 19, 2015 21:50
Subject:
Re: Question/suggestion on perlfunc.pod example
Message ID:
CALJW-qFgqvWyfYnufKs142wAWAQ07a-4KUv-u94xYWV1QkjGvA@mail.gmail.com
On Fri, Jun 19, 2015 at 5:11 PM, Aristotle Pagaltzis <pagaltzis@gmx.de>
wrote:

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

Not true. If you had bothered to check, you would have noticed that do
reported there's an error in $!.

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