develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
From:
David E. Wheeler
Date:
July 25, 2013 19:07
Subject:
Re: Try/Catch Exception Objects: Possible?
Message ID:
6EC98E85-5FBE-4735-8E43-E40D3EE720F1@justatheory.com
On Jul 25, 2013, at 7:34 PM, David Nicol <davidnicol@gmail.com> wrote:

> It would be good for catching all errors in a library.
> 
> With that use case in mind, having a package catch scope might be good
> too, which would get checked whenever an exception happens in a named
> sub that lives in that package, after the file lexical scope. We'd
> need a way to specify that we're writing into the package scope and
> not the file scope, how about COLON-COLON, or just fully qualified,
> that way you could write them into other packages

Don’t we have a package scope since 5.14 or so if you use a block?

    package Foo {
        CATCH {
            # BOOM.
        }
    }

David


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