Hi George --

> OK, maybe I'm not too savvy at using ActiveState's PPM (Perl Package
> Manager), but the latest version of CGI::Application I can find
> in either of
> the two repositories I can find (maybe there are more?!), is version 1.2.

Yeah.  ActiveState is sorely out of date!  Please go bug them to get a more
recent version!  They don't seem to have an open system such as CPAN, so I'm
a bit at a loss to figure out how to get a more recent version on their
system.

Plus, I don't think those guys much like CGI-App:

    http://velocity.activestate.com/code/cpan/c/cg/CGI-Application.html

    "Description:  Intended to make it easier to create sophisticated,
reusable web-based applications. This module implements a methodology which,
if followed, will make your web software easier to design, easier to
document, easier to write, and easier to evolve. Or so says the author. We
prefer Mason."


D'oh!  Hehe...


> This leads me to the following issue.  I read the readme's on
> CPAN for more
> recent versions.  In particular I was interested in the following change
> from v1.3.1 noted in the readme for v2.0 (I know you are up to v2.1
> however):

There are a lot of really significant changes between 1.2 and 1.31 (and
2.1!)  Definitely upgrade.  There are no architecture-specific parts in
CGI-App, so copying the "Application.pm" should work, if ActiveState's lame
PPM doesn't work.


> my $fq_tmpl_file = $self->tmpl_path() . $tmpl_file;
> Could be rewritten as:
> My $fq_tmpl_file = catfile($self->tmpl_path(), $tmpl_file);
> Guess I should get v2.1 off CPAN.  If anyone's interested, I'll hack the
> source myself and test it, then submit it as a patch?!  (Actually
> I may also
> want to strip a possible delimiter off the end of tmpl_path, for backward
> compatibility .... ah the wheels are turning ....)


No need to patch -- just sub-class!

    package MyCGIApp;
    use base 'CGI::Application';
    sub load_tmpl {
        my $self = shift;
        my $t;
        # Do whatever you want here!
        return $t;
    }

Now, have your modules inherit from "MyCGIApp" instead of
"CGI::Application".  Presto-blammo, you should now have your own load_tmpl()
method.

By all means, submit a patch.  My only caution is that CGI-App currently
only requires two modules: CGI.pm and HTML::Template.  More functionality
means more dependencies, which is probably not a good thing.  If there is a
general outcry in favor of your patch, I would gladly include it.


TTYL,

-Jesse-




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to