* Nik Clayton <[EMAIL PROTECTED]> [2007-01-24 16:45]:
> Anyone used this approach before, or done anything similar?
I haven’t, but it seems perfectly reasonable if you can live with
Fatal’s annoying stack traces.
Another option would be something like
sub ensure { $_[ 0 ] or die "broken promises" }
# ...
ensure isa_ok $foo, 'Frobnitzer';
ensure is $foo->bar, $bar->bar, "Barbar is foobar";
which is still repetitive, but IMHO much less of a pain than
trailing `or bail` clauses, particularly as it’s miles easier
to add and remove en masse using a good editor.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>