logo       

C:A and mod_perl2: msg#00293

Subject: C:A and mod_perl2
I have successfully setup my CGI::Applications so that a single app module can be run under 3 different environments - mod_cgi instance script, ModPerl::Registry and an Apache PerlResponseHandler, under both Linux and WinXP OS's on a dual-boot development system. Firstly, is there any practical reason why this 3-way arrangement should not be done on a production (or even development) system?

Anyway, it seems to work well provided I set the handler method to call a separate Handler.pm module, which then 'uses' my main app module. As I should be able to dispense with the Handler module and put the handler directly into the main module, I used the scheme outlined in http://www.mail-archive.com/cgiapp@xxxxxxxxxxxx/msg00486.html.

But as I understand it, the 'sub handler ($$)' method is not available to mod_perl 2.0, and doesn't work anyway, so I substituted the mod_perl2 'sub handler : method' as follows:

sub handler : method {
  my ($class, $r) = @_;

  my $self = $class->new(
   PARAMS => {
    't0' => [gettimeofday],
# app_url changes according to whether called via mod_cgi, mp registry or mp handler
    'app_url' => 'http://127.0.0.1/hilis',
   }
  );
  $class->run();

  return Apache::OK;
}

This has no adverse effect when called via mod_cgi or MP:Registry (presumably they ignore it), but gives the following error when called via a Perl handler:

[error] [client 127.0.0.1] Can't use string ("HILIS4") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.7/CGI/Application.pm line 449.\n

HILIS4 is the name of my app module. Line 449 of Application.pm reads:
unless (exists($self->{__QUERY_OBJ})) {

Also getting this error:
-e: Odd number of elements in anonymous hash at /usr/lib/perl5/site_perl/5.8.7/CGI/Application/Plugin/AnyTemplate/Base.pm line 85.

Perhaps these errors are connected? As far as I can tell the handler : method block is correct. Any ideas? Hope this is not too confusing.
--
Richard Jones
Leeds, UK
mailto:ra.jones@xxxxxxxxxxxxxxx

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe