Recently I had to touch an old module, which is a general purpose database table row viewer/inserter/updater/deleter.
The behaviour of this module can be set up by exported hashes, and variables. It has a delete function which is deleting a row from the DB table. I wanted to add some functionality to its behaviour, but only for one table. So i added a new subroutine to the script that uses the module, and set up another exported variable to tell the module it can call the sub from the script.
But I feel it is very weak. First of all there is already too much exported variables, I don't want to follow the original authors stupid practice, and I would like to have elegant code. I would like to check from the module if the subroutine is existing in the caller namespace. Or at least in main namespace.
Is that possible? Thanks for any ideas.