praise and suggestions

"Raful Mr Mitchell H" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <4BEB8E9952EF544284F706EAD70820B30A3F7959@hqex2ksvr01.windows.usmc-mccs.org>
All:

I worked on a script that does lots of snmp queries via Apache and Perl.  I was using Mason.  However, some of my Net::SNMP return values were garbled.  My assumption was it was the fact that embedded templating uses a callback method.  I rewrote everything in HTML::Template and voilla!  I'm thrilled.  Now I need some feedback to see if I am taking full advantage of mod_perl.  Should I change any of the following:

relevant piece from apache2.conf

PerlModule Apache::DBI
Alias /perl/ /usr/lib/cgi-bin/
PerlModule ModPerl::Registry
<Location /perl/>
SetHandler modperl
PerlFixupHandler +Apache::DB
PerlResponseHandler ModPerl::Registry
Options +ExecCGI
PerlOptions +GlobalRequest
PerlSendHeader On
Allow from all
</Location>
<Perl>
use Carp
</Perl>
PerlPostConfigRequire /usr/local/lib/site_perl/Apache2/startup.pl

relevant portion from sites-enabled/default (I am using Ubuntu.)

<VirtualHost *>
 ServerAdmin webmaster@localhost
	DocumentRoot /home/mitch/www-dev/yanma
       ServerName yanmadev.usmc-mccs.org
	<Directory /home/mitch/www-dev/yanma>
            DirectoryIndex index.html
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>
  	<Location /perl>
		SetHandler perl-script
      		PerlResponseHandler ModPerl::Registry
      		PerlOptions +ParseHeaders
      		Options +ExecCGI
      		Order allow,deny
      		Allow from all 
  	</Location>

Finally startup.pl

#!/usr/bin/perl

use lib qw(/usr/local/lib/site_perl/Apache2);
use HTML::Template;
use File::Find;
use ModPerl::Util;
use ModPerl::Registry ();
use Apache::DBI;
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::RequestUtil ();
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
use Apache2::Connection ();
use Apache2::Log ();

use APR::Pool ();
use APR::Table ();

use Apache2::Const -compile => ':common';
use APR::Const -compile =>  ':common';
use Socket qw(:DEFAULT :crlf);
use Net::SNMP;
use Net::Ping;
use Net::NBName;
use DBI;
use DBD::ODBC;
Apache::DBI->connect_on_init( 'dbi:ODBC:MRIServer2k', '******', '******',
                           { PrintError  =>  1, RaiseError => 0, AutoCommit => 1 } );

print STDERR    "Pre-loading HTML Template...\n";
find (
      sub {
        return unless /\.tmpl$/;
        HTML::Template->new(
                            filename => "$File::Find::dir/$_",
                            cache  => 1,
                           );
      },
      '/home/mitch/www-dev/yanma/',
     );
1;


Thanks,

Mitch


Mitch Raful, MCSE CCNP
Network Engineer
HQMC MCCS
3044 Catlin Avenue
Quantico, VA 22134
703-784-5991
"T'm Mitch Raful, and I approved this message." 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.