Hi all,

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
-- Foxcub


In reply to Modules of Formats by Tanalis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.