On Wed, Oct 05, 2005 at 16:57:51 +0100, Peter Haworth wrote:
> On Mon, 26 Sep 2005 20:17:05 +0200, TSa wrote:
> > Piers Cawley wrote:
> > >>Exactly which exception is continued?
> > > The bottommost one. If you want to return to somewhere up its call
> > > chain, do:
> > >
> > >   $!.caller(n).continue(42)
> >
> > Whow, how does a higher level exception catcher *in general* know
> > what type it should return and how to construct it? The innocent
> > foo() caller shouldn't bother about a quux() somewhere down the line
> > of command. Much less of its innards.
> 
> Well said.


No! Not well said at all!

The exception handler knows *EVERYTHING* because it knows what
exception it caught:

        CATCH {
                when some_kind_of_error {
                        $!.continue($appropriate_value_for_some_kind_of_error)
                }
        }

-- 
 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me climbs a brick wall with his fingers: neeyah!

Attachment: pgpZ51c9ny7Ry.pgp
Description: PGP signature

Reply via email to