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

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
David E. Wheeler
July 25, 2013 19:07
Re: Try/Catch Exception Objects: Possible?
Message ID:
On Jul 25, 2013, at 7:34 PM, David Nicol <> 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.


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