develooper Front page | perl.perl5.porters | Postings from September 2010

Re: warn always returns true

Thread Previous
From:
Eric Brine
Date:
September 20, 2010 08:43
Subject:
Re: warn always returns true
Message ID:
AANLkTi=gd8V8u_pfgks4EGy2GtW3X1yf30our2DH3OS3@mail.gmail.com
On Sun, Sep 19, 2010 at 6:40 PM, Dr.Ruud
<rvtol+usenet@isolution.nl<rvtol%2Busenet@isolution.nl>
> wrote:

> I think it should be documented that warn() always returns true.
>

Why constrain future versions of warn to return true?

was:
eval { 1 / $x } or warn( "1:", $@ ) and warn "2";

fix:
eval { 1 / $x } or ( warn( "1:", $@ ), warn "2"; );
eval { 1 / $x } or do { warn( "1:", $@ ); warn "2"; };
if (!eval { 1 / $x }) { warn( "1:", $@ ); warn "2"; }

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About