status() vs constants
I've got a module which wraps the creation and execution of an object inside of
a few routines. It's up to those routines to set the status(). If the class
can't be found it's a 404, if the object doesn't execute it's a 500, etc.
Now, in my handler sub I want to return the corresponding constant for whatever
status() is set to. Under mod_perl 1.x this worked by just returning the
status() since OK == 200, SERVER_ERROR == 500, etc. But this isn't true under
mod_perl 2 (as far as I can tell). My module needs to work under both, so I need
a better way.
I'd rather not have to check every possible status() value in a huge if/else
tree to return the right constant, but I guess I will if there's no other
choice. Please tell me there's an easier way.
Plus Three, LP