Oops...gotta hate when the top of your message directly conflicts with the bottom of the message.

I should have said 'may be faster' not 'is faster'. The OO style is less memory intensive. In some situations, especially under mod_perl, the difference can be noticable.

There is also, as mentioned in the CGI CGI docs, a little bit of overhead when importing the functions into your namespace that will most likely be more apparent when running shorter scripts.

So basically, although the individual method/function calls may be a little bit slower under OO, the overhead it initialization may strip you of that speed.

Of course, this goes back to the problem of benchmarks -- someone else's tests may not be representative of your situation, so if you're worried about it, you'd want to run your own tests.


In reply to Re^3: why use OO nature in CGI? by jhourcle
in thread why use OO nature in CGI? by sulfericacid

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.