On Tue, 2 Jan 2001, Ken Williams wrote:

> >Error:
> >
> >[Tue Jan  2 16:02:37 2001] [error] Can't locate object method "uri" via
> >package "Apache::PerlRun" at
> >/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Apache/PerlRun.pm line 212.
> 
> Jie,
> 
> Try this patch.  Does it solve the problem?
> 
> ------------------------------------------------------------
> --- PerlRun.pm  Mon Oct  2 01:02:05 2000
> +++ PerlRun-new.pm      Tue Jan  2 00:59:15 2001
> @@ -209,7 +209,7 @@
>      my $pr = shift;
>      if ($@ and substr($@,0,4) ne " at ") {
>         $pr->{r}->log_error("PerlRun: `$@'");
> -       $@{$pr->uri} = $@;
> +       $@{$pr->{r}->uri} = $@;
>         $@ = ''; #XXX fix me, if we don't do this Apache::exit() breaks
>         return SERVER_ERROR;
>      }
> ------------------------------------------------------------
> 
> 
> I don't quite understand the voodoo of this line and what it's supposed
> to do, so I'm not sure about the validity of this patch.  But I think it
> might solve the problem if anything does.

Thanks for the patch. I put that in and I haven't seen the error again
yet.

Another problem with PerlRun is that it seems to interfere with mod_perl
handlers.

I have an authentication/authorisation handler, which reads in from a
file for someinformation. After a script under PerlRun is run, the handler
fails to read anything from that file anymore.

I have the following in the handler:

    # Get the db server login info.
    if (defined $dsf) {
        open(DBCONF, "$dsf") || $r->log_error("Can't open DSF file $dsf:$!");
        while(<DBCONF>){
            next if /^#/;
            next unless /^$ds_name:/;
            print STDERR;
            chomp;
            ($ds_name, $db_f_name, $db_user_name, $db_user_pwd) = split(':', $_);
            last;
        }
        close DBCONF;
    } else {
        $r->log_reason("DB source file not defined.") if ($debug > 3);
        return SERVER_ERROR;
    }

    unless (defined $db_f_name && defined $db_user_name && defined $db_user_pwd) {
        $r->log_reason("DB source file error: definition incomplete: 
db_f_name=\"$db_f_name\"; db_user_name=\"$db_user_name\"; 
db_user_pwd=\"$db_user_pwd\".") if ($debug > 3);
        return SERVER_ERROR;
    }

After the PerlRun script is run, i.e, the sencond time I run the
PerlRun script, all these variables I get from the file become
undefined, and I get the server error.

This won't happen if I turn PerlRun off.

Any solution to this?

Thanks,




Jie

Reply via email to