in reply to Returning Error Codes

Another poor practice - you could adopt the unix exit code strategy. Return 0 or undef for success, and an error code in other cases. Then you can do
unless( my $error = foo() ){ # do some stuff }else{ warn "whoops, foo() failed, error code: $error\n"; }
Really, I'd suggest the die strategy, but this is closer to what you desired....