in reply to style for returning errors from subroutines

One approach I've been using is to define a &fail sub, and use it in place of die() throughout my code. I.e.
open (FILE, ">>$file") or fail "Couldn't open $file";

fail then decides how to act, given the string. It can simply log and die, or it can parse the string and warn instead of dying.

This gets slightly messy with multiple modules, but that's eased if you're using OO, so long as fail sits up top in your objects' family tree and you're using $self->fail.

The really tricky thing about this approach is that if you want die/warn to correctly report the line number, you're going to have to play with caller.

But for real power, look into Error.pm, which could be described as an OO eval on steroids.

-- Frag.