To use ModPerl, do I have to put the extra lines in my http.conf file?

You need to add an alias directive so that you have a directory which is where you will place your mod_perl scripts. Then you need to add a Location directivev which configures the directory so that files therein are handled by the Apache::Registry Handler and executed under mod_perl.

Will htaccess do?

No

Also, I thought I heard that there was a way to simply "include" a library at the top of a Perl script to use ModPerl. Is this true?

No, the grunt work of mod_perl itself is done at Apache startup time.

Running in Apache::Registry mode it is often possible to run existing CGI scripts under mod_perl to get the performance benefits without significant re-writing. Of course, the scripts need to be "well behaved" in their use of global variables. The book Practical mod_perl will provide invaluable advice and information, as will the basic mod_perl documentation from the apache.org website. Their are specific sections of the doc's on just these issues.

jdtoronto


In reply to Re: Using ModPerl by jdtoronto
in thread Using ModPerl by rjahrman

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.