a lot of methods are in different namespaces.

It was mod_perl1's mistake to not be so modularized in the first place. mod_perl2 does a much better job of this.

the output doesn't work like in CGI, where you just print to STDOUT.

mod_perl coding != CGI coding. A more rigrious API, as opposed to STDIN/STDERR, should be considered a good thing. The best you can say about the CGI method is that it follows the Unix pipe model well. But what works so well for command lines doesn't work so well over networks. It's long past time that we move beyond this.

Also to flush, $|=1 doesn't work, you need to call rflush() for each flush.

Blame Perl for making a default global variable do autoflushing for every single file handle in your program (unless you localize it). Update: Oops, only does it for the currently selected filehandle. Thanks to chromatic for pointing this out.

Actually the biggest problem is that to use mod_perl 2.0 we have a lot of new things.

So you had to upgrade your Perl and Apache versions to get the biggest change in Perl-based web programming since mod_perl was first released? Seems a small price to pay.

If there is any problem with mod_perl2, it's that its documentation is lacking. Such as what you mentioned about converting to the new API.

I'm also very excited about its ProtocolHandlers. One of these days I'll have to get around to writing a Gopher handler.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated


In reply to Re: Experiencing with mod_perl 2.0 (1.99) by hardburn
in thread Experiencing with mod_perl 2.0 (1.99) by gmpassos

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.