I'm working on a large, dynamic web site thats written in a perl 4ish style. No strict, warnings, modules, OO, templating or even CGI.pm. Lots of global variables, subs called with &do_something; syntax (accessing enclosing @_), database access on every page with hardcoded dbi strings. In short, the very opposite of what the monks consider good style. It does, however, work (albeit with a few dropped database connections and a bit slow.)

The current environment is perl 5.8.3, apache 2. The wish is to migrate to mod_perl and clean it up.

The minimal option is to clean each page that breaking under mod_prel or when new functionality is needed. Add strict, warnings, obvious modules (CGI.pm?), but still keeping it as CGI-ish, and letting the Registry modules handle the mod perl integration.

The maximul option is to redesign the site from scratch, using mason or Template Toolkit. Then flip the switch. This seems like overkill unless serious new functionality is being considered.

The question is - how much to do, and how to do it.

A hybrid approach seems possible, but perhaps more difficult to plan. Can you slowly transform a legacy site into something that looks freshly built? Any advice on strategies, tips, pitfalls, resources (is Practical mod_perl worth the read?), etc., much appreciated.

There are interersting CGI/mod_perl discussions at these nodes 174307, 253921, 367315, and the official porting guidelines.

thanks, qq


In reply to how to migrate a large perl 4ish CGI site to mod_perl by qq

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.