Heh, interesting play with the modules ;-) -- although, I can't quite grasp the purpose for such a 'wrapper'. Anyhow, straight onto the question..

Thou art pleas:

did I just get lucky? Am I doing this the most efficient way, or should I be returning a reference to the CGI object?!?

Yes, and no. Yes, you are lucky that you have such a wonderful tool at your disposal as Perl :). Your module is built properly. Frankly, I don't see anything peculiar about it. For the second question, I say 'no' because you are already returning reference to the CGI object, don't you? In your new_cgi() method you are simply invoking the cgi constructor (new()) which returns a reference to a blassed 'CGI' hash. You than simply return that same reference to the caller of your constructor. Therefore, indeed you only deal with references here. I see no point optimizing any further in this direction.

UPDATE: removed my statement of 'faith'.. untill I come up with a new one :)

In reply to Re: using modules already 'used' (part 2) by vladb
in thread using modules already 'used' (part 2) by cLive ;-)

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.