Hi again.

(I was going to post on perlguru.com but some database issue seems to have gone wrong with that site. That aside..)

Greetings again.

2 years ago I wrote a module with utilities that invoke it. It all works well but it was not properly organized for CPAN. So the code is all there but I need to start fresh and transplant code from the older module as appropriate. However, I also want to use this as an opportunity to practice Moose and Function::Parameters and other trappings of "Modern Perl". And at the gate I have run into question on how to proceed. Here is the stub code that my h2xs invocation created; I have joined lines to keep it clear.

package DBD::Informix::DBspaces; use 5.022001; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( ); our $VERSION = '0.01';

(Yes, this is Informix oriented, for those who recognize the buzz words.) I'm planning three packages in here, with the "DBD::Informix::DBspaces" package referencing the other two. So now I have two questions:

- Do I need to specify "use Moose" in every package I define in that .pm file? Or will the one "use Moose" in the first package suffice for the other packages as well. Or how about "use Moose" even before the first "package" directive?

- All those "our" declarations and the "require", generated by h2xs: Do those need to be repeated in each package or is is sufficient to put them all up front, outside all the packages? I suspect that outside all packages will be fine but if it is not fine I will be greeted by a barrage of errors masking any syntax errors and other small stuff.

So this misunderstood less-than-genius seeks the experience of those who have already played in these fields and humbly thanks thee. (What's plural for thee? :-)


In reply to Moose in a module created with h2xs by rpaskudniak

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.