Jan Theofel wrote:
Hello,

I have a very simple perl script which I try to run with
Apache::PerlRun. After changing the directory section in the apache
configuration file and a restart I get no repsonse to my client and the
error file fills with:

[Sun Nov 24 17:59:45 2002] shop.pl: Subroutine main redefined at
/home/www/[...]/shop/engine/shop.pl line 19.
This is a warning, not an error.

Google found some problems and solutions for that, but they all seemed
to be for Apache::Registry and not for Apache::PerlRun.
::Registry and ::PerlRun are very similar, most things that apply to the former apply to the latter, see docs for more info.

Here's the script (a few comments snipped away):
--- snip ---
#!/usr/bin/perl -w

  use strict;
  use eqtools;
  use eqdbtools;

  &main;
  1;

sub main {
# -- create a new session --
  &open_db();
  my $sid = &create_session();
  &track_request($sid, "?THIS_IS_A_NEW_SESSION");
  &close_db();

# -- forward the browser to the following page --
  if($sid ne "")
  {
    print "Status: 302 Moved\n";
    print "Location: /static.pl?sid=$sid&page=home\n\n";
  }
  else
  {
    &fatal_db_error("FATAL ERROR CREATING A NEW SESSION!", "-");
  }
}
--- snap ---


And here is the section form my apache configuration file:
--- snip ---
    <Directory "/home/www/[...]/shop/engine">
      AllowOverride AuthConfig
      Order allow,deny
      Allow from all
      SetHandler perl-script
      PerlHandler Apache::PerlRun
      Options +ExecCGI -Includes
      PerlSendHeader off
That should be:

  PerlSendHeader on

since you manually print your headers.




__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to