The mod_perl site

What is mod_perl?

Have a look at the user docs for 1.0 to start expecially the 'Coding guidelines' and 'Frequent mod_perl problems' sections.

The mod_perl documentation is amongst the best open source documentation on the web. It is well worth a read.

In a nutshell if you program like this it will generally work:

#!/usr/bin/perl -w use strict; use Module qw( do_stuff ); my $var = .... do_stuff($var); exit 0;

The easiest way to mod perl is use strict and put all your functions into modules and have very simple scripts. In essence mod perl wraps your script into a subroutine that gets called over and over. That means that global vars do not get reset between calls to the script {now effectively a sub in the long running mod_perl 'script'} so you can have persistent DBH on the one side and unexpected bugs on the other. If you localise with my and Modularise the problems will mostly vanish. # you don't put subs in a mod perl script..... # unless you want lots of warnings.... # /o will bite you too.

It runs a lot deeper than that when you start hacking the api.

cheers

tachyon


In reply to Re: What is mod_perl? by tachyon
in thread What is mod_perl? by selk

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.