|
|
| "be consistent" | |
| PerlMonks |
Re: How to call a Sub / Function with changing nameby kcott (Archbishop) |
| on Oct 29, 2010 at 01:08 UTC ( [id://868196]=note: print w/replies, xml ) | Need Help?? |
|
If that's for a one-off script, you appear to have your answer. For a solution that's to be used in the longer term, you might consider something along the lines of the following skeleton code: In a module, say Medical.pm:
Then, in your script:
When you later need to process a new file, say diseases, you don't need to update a dispatch table or change your script in any way. Just add sub diseases { ... } to Medical.pm. -- Ken
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||