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

Re: Why $@ makes me cry (was Re: Generic system() replacements)

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
June 25, 2008 03:38
Subject:
Re: Why $@ makes me cry (was Re: Generic system() replacements)
Message ID:
20080625103833.GA7025@klangraum.plasmasturm.org
* Mark Mielke <mark@mark.mielke.cc> [2008-06-24 23:40]:
> What about some compromise whereby $@ is saved before, and
> only restored if DESTROY completes successfully without an
> exception?

Some compromise… it would break *everyone*’s code:

    eval {
        # ...
    };
    if ($@) {
        # now you might get here even though
        # the `eval` block ran successfully
        # ...
    }

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