Hi,

I repost this, because I got no respond:

I use the following configuration:

  <LocationMatch /(xx|yy)>
   PerlHandler    Apache::MyPkg
   SetHandler     perl-script
  </LocationMatch>

and the handler is defined in this way:

  package Apache::MyPkg

  require 5.005;

  require Apache::Request;

  use     constant TmpDir => '/var/tmp';
  use     strict;

  sub handler ($)
  {
      my $apr = Apache::Request->instance(shift, TEMP_DIR => TmpDir);

      ...
  }

But the first which I have not expected is that $^S is always true
inside this handler. The other problem is that

        die "text which does not end in a newline"

shows

        text which does not end in a newline during global destruction.\n

instead the expected

        text which does not end in a newline at __FILE__ line __LINE__.\n

Is this a bug in mod_perl? I use mod_perl 1.25 and Perl 5.00503. 5.6 is no
choice, because there is a known incompatibility of mod_perl, Perl 5.6 and
the platform I must use.
My current work around is:

  require Error;

  ...

  sub handler ($)
  {
      my $apr = Apache::Request->instance(shift, TEMP_DIR => TmpDir);

      local $SIG{__DIE__} = sub
      {
          my $txt = join '', @_;

          local $Error::Depth = $Error::Depth + 1;

          $txt =~ s/\s+during\s+global\s+destruction.\s*\z//;
          die(Error::Simple->new($txt)->stringify);
      };

      ...
  }

TIA, Silvio

Reply via email to