tune has asked for the wisdom of the Perl Monks concerning the following question:
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.
--
tune
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: checking from a module if a sub exists in main::
by dragonchild (Archbishop) on Nov 20, 2001 at 01:54 UTC | |
|
(Ovid) Re: checking from a module if a sub exists in main::
by Ovid (Cardinal) on Nov 20, 2001 at 01:57 UTC | |
|
Re: checking from a module if a sub exists in main::
by premchai21 (Curate) on Nov 20, 2001 at 02:55 UTC |