eval { foo() } ; if ( $@ ) {
bar();
die $@
}
Does bar() throw an exception itself? If it doesn't now will it sometime in the future? What about the stuff that bar() calls? What about the next version of the module Foo used by module Bar used by the bar() function?
If you rely on $@ you're relying on everything in your exception handling code restoring it before you use it. Me - I'll copy it instead. Coupling bad.
Sure the overloading thing is daft - but that doesn't mean copying $@ isn't the right thing to do. |