|Perl Monk, Perl Meditation|
Modules of Formatsby Tanalis (Curate)
|on Oct 01, 2002 at 08:54 UTC||Need Help??|
Tanalis has asked for the
wisdom of the Perl Monks concerning the following question:
I'm writing a script that will be generating a large number of similar reports, each of which has its own format header and body.
I'd like to export all of these formats to a dedicated ReportsFormats module, simply to make the script easier to follow and look less cluttered.
I'm after advice and opinions, I guess - is it valid to have a module of formats, how would I go about exporting them (Exporter in the usual way?) and how could I go about avioding the problem of the Perl compiler not finding the variables in the formats because they're not local to the format module itself (though I suppose not using strict is an option there).
Any advice/suggestions would be appreciated. This isn't fundamental .. but I hate cluttered code and for the sheer number of formats we use doing it this way would make it much, much easier to understand and maintain the script.
Thanks in advance