> 2. We will use Template-Toolkit and Apache/mod_perl. Problem is that 2
> out of 3 people have never used TT or programmed mod_perl and OO Perl.
> Only I've made sites this way, they've used Embperl til now. How can I
> make this switch for them a little easier?

Get them all copies of the Eagle book and Damian's OO book (or the Advanced
Perl Programming book, which I also like for OO).  Have them read at least
the porting and traps documentation that comes with mod_perl, if not the
whole Guide.  Decide if you will be using a framework like OpenInteract or
OpenFrame.  If not, decide on a basic structure for request handling, error
handling, and parameter parsing, and document it.

We made this same transition at eToys, and you can do it.  Learning to use
TT is pretty quick, but OO and mod_perl require more hand-holding and are
much easier if you have someone around with some confidence in how to use
them.

I'm including a brief outline that I used when I gave a talk about mod_perl.
It's slightly out of date, but it shows what I considered to be the
highlights for mod_perl newbies.

> Which data should I send with cookie? Only some random
> key which is also stored in dbase and this key is used to find real data
> from dbase?

Yes, use a unique key with some kind of MAC so you can be sure it isn't
forged when it's sent back to you.  See the recent thread and the AuthCookie
module.  Note that some things still have to passed as query args or hidden
fields.  This would be anything that could be happening in multiple windows,
like search terms (if you tied them to the cookie, searches in multiple
windows would interfere with each other).

> 4. How is most reasonable to store(and use too) complex formulas and
> coefficients?

I would use an OO approach with polymorphism, like others have described.

- Perrin
  • What is mod_perl?
    • An Apache module.
    • An embedded Perl interpreter.
    • Fast.
    • Flexible.
  • What's wrong with CGI?
    • Forking Perl on every request.
    • Compiling the script every time.
    • Opening a new database connection every time.
      • Apache::DBI.
  • The Apache request lifecycle.
    • See diagram.
  • The Apache API.
    • See code listing.
    • $r
      • $r->headers_in->{'User-Agent'}
      • $r->parsed_uri
      • $r->args
    • The config file.
  • How mod_perl emulates CGI.
    • Apache::Registry
    • Apache::PerlRun
  • What do you need to know as a programmer?
    • Memory management.
      • use strict! use strict! use strict!
      • Pre-loading and copy-on-write.
        • See diagram.
        • startup.pl
      • Imported symbols and use vars.
    • Traps
      • Global settings: $/, $^T, $^W, $|
        • Using them safely with local.
        • -M test implications.
      • use, require, do, and %INC
      • Compiled regular expressions.
        • See the guide or Perl Cookbook.
      • BEGIN and END blocks.
    • Performance tweaks.
      • Apache::Request for query string.
        • See listing.
      • Apache::Cookie for cookies.
        • See listing.
      • Apache::Util for escaping HTML and URIs
        • See benchmark.
      • DBI: prepare_cached and finish
    • Reloading your code changes.
      • Restart the server.
      • Apache::StatINC.
      • Stonehenge::Reload.
      • PerlFreshRestart.
      • Memory considerations for live servers.
    • Profiling
    • Debugging
  • Tricks to use in production.
    • Apache::SizeLimit.
    • Proxy server setup.
  • Resources
    • Read the guide! - http://perl.apache.org/guide/
    • PerlMonth - http://perlmonth.com/
    • perldoc everything
    • The Eagle Book and http://www.modperl.com
    • the mailing list
  • Comparison to other systems?

Reply via email to