Chaim Frenkel <[EMAIL PROTECTED]> writes:

> >>>>> "PC" == Piers Cawley <[EMAIL PROTECTED]> writes:
> 
> PC> The (continue|always|finally|whatever) clause will *always* be
> PC> executed, even if one of the catch clauses does a die, so you can use
> PC> this to roll back the database transaction or whatever else was going
> PC> on and restore any invariants.
> 
> Err, how does one differentiate between a 'good' entry and a 'bad'
> entry.

Um, if the try block completed without tripping a catch clause then it
worked. If it didn't, then it didn't.

If you want to be able to have the continue block not unwind on some
occasions then have it check the value of $@.

> PC> Note too that we don't need to do any case based magic, we can and
> PC> should use polymorphism for that.
> 
> Why? Just because?

Good OO programming practice. Use polymorphism to replace switches. Then
when you subclass one of your classes you don't have to go 'round
rejigging the switch statements.

-- 
Piers

Reply via email to