in reply to Changing a subroutine to a module
It makes absolute sense to use it in a module. I'd also suggest changing the name, of the subroutine slightly, though. Perhaps call it handle_db_error. then you can have other routines such as handle_io_error, or somesuch.
Now read chapter 11 of the Bible. There are too many options to really specify how to do this in a single post. Are you going OO, for example? Do you want to have the routine available in all scripts, or should it be imported explicitly?
|
|---|