You can not run this script in the shell because it expects a Apache::Request-Object which is passed by Apache::Registry to you. Why you are getting Apache::Request is because Apache::Registry is wrapping your "CGI"-Code in an subroutine. The code run inside mod_perl looks something like the following:

package .....

sub handler
{
  use strict;
  use diagnostics;
  my $r = shift;
  $r->print("Content-type: text/plain\n\n");
  $r->print("It works");
}

Tom

Garry Heaton wrote:
Sorry, Stas, I jumped the gun editing your original. Just tested:

#!/usr/bin/perl -w
use strict;
use diagnostics;
my $r = shift;
$r->print("Content-type: text/plain\n\n");
$r->print("It works");



./test.pl produced:

Can't call method "print" on an undefined value at ./test.pl line 6 (#1)
(F) You used the syntax of a method call, but the slot filled by the
object reference or package name contains an undefined value. Something
like this will reproduce the error:

$BADREF = undef;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);

Uncaught exception from user code:
Can't call method "print" on an undefined value at ./test.pl line 6.

Garry






--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to