I released my first module, Class::Trait to CPAN a week or so ago. But to be honest, I had always thought of it as a more pragma-ish module though, and had in the early stages called it trait rather than Class:Trait. Eventually though Class::Trait stuck, and it was released as that. But now as I am tweaking the code more, and experimenting with using the module, I am thinking it is more appropriate as a pragma, and maybe I should rename it as such.

Class::Trait does 90% of its work in the BEGIN phase, the other 10% in the INIT phase and provides no functions for any outside modules to call. It also does a whole lot of symbol table analysis & manipulation. To me that is a pragma. But I think Class::Trait is more appropraite as a pragma not just because of when and how it does it's work but also because I think the syntax would be cleaner. Consider the current state:

use Class::Trait "TPrintable";
Versus the pragmatic name:
use trait "TPrintable";
I know it is not a huge difference, but to me it just reads better and feels cleaner.

I am wondering how people feel about pragma-style module names compared to more "regular" module names. It seems that the pragmas section on the CPAN is one of the more sparsly populated areas, although I know this is only the registered ones. Am I just not seeing the bredth of pragmas out there, or are there really just not that many? When proposing a module name/namespace through the PAUSE web interface, pragmas are not even listed as a category, but as an interface style. Is there a reluctance out there to use/accept pragmas over "regular" modules? What do you all think?

-stvn

In reply to RFC : Pragma vs. Module by stvn

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.