perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: mp2: make test fails on NetBSD 1.6.1
Date Thu, 05 Jun 2003 02:10:17 GMT
Carl Brewer wrote:

> Can't call method "method" on an undefined value at 
> /data/src/modperl-2.0/Apache-Test/lib/Apache/TestRequest.pm line 411.
> *** Error code 61
> 
> Stop.
> make: stopped in /data/src/modperl-2.0
> steel1: {10}
> 
> 
> Do I need to send you something else as well?  That doesn't look any
> more useful...

Right, I should have tested. The problem comes from the client side, not the 
server, so my previous patch wasn't helping. This should work (now tested)

Index: Apache-Test/lib/Apache/TestRequest.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
retrieving revision 1.78
diff -u -r1.78 TestRequest.pm
--- Apache-Test/lib/Apache/TestRequest.pm       24 Apr 2003 05:16:57 -0000 
  1.78
+++ Apache-Test/lib/Apache/TestRequest.pm       5 Jun 2003 02:04:44 -0000
@@ -408,6 +408,9 @@

      unless ($shortcut) {
          #GET, HEAD, POST
+        require Carp;
+        $SIG{__DIE__} = \&Carp::confess;
+
          if ($r->method eq "POST" && !defined($r->header("Content-Length")))
{
              $r->header('Content-Length' => length($r->content));
          }

And your trace will look something like:


... 
Apache::TestRequest::lwp_call('Apache::TestClient::GET','undef','/index.html') 
called at 
/home/stas/apache.org/mp-filters/Apache-Test/lib/Apache/TestRequest.pm line 457
         Apache::TestRequest::__ANON__('/index.html') called at 
/home/stas/apache.org/mp-filters/Apache-Test/lib/Apache/TestServer.pm line 554
...

now to shortcut things, the problem happens here in 
(Apache-Test/lib/Apache/TestRequest.pm):

sub lwp_call {
     my($name, $shortcut) = (shift, shift);

     my $r = (\&{$name})->(@_);
     my $error = "";

$r doesn't get set to anything.

what happens if you replace:

   my $r = (\&{$name})->(@_);

with:

     require Carp;
     my $r = Apache::TestClient::GET->(@_);
     Carp::confess("oops") unless defined $r;

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message