[Zope-Perl] How to get REQUEST's and RESPONSE's

Greg Green gregory.p.green@boeing.com
Wed, 14 Mar 2001 11:29:08 -0800


> > Also I tried an unrestricted Perl script, testperl.pm:
> > ---------------------------------------------------------------------
> > package testperl;
> > require Exporter;
> > @ISA = qw(Exporter);
> > @EXPORT = qw(testit);
> >
> > sub testit {
> >     local $self = shift @_;
> >     local $REQUEST = shift @_;
> >     local $RESPONSE = shift @_;
> >
> >     return $REQUEST->items();
> > }
> >
> > return 1;
> >
> > ---------------------------------------------------------------------
> > This is installed in ZopeBase/Extensions/ZopeExt/testperl.pm
> >
> > When I try it I get:
> >
> >      ErrorType: PerlError
> >      ErrorValue: Undefined subroutine
> >      &ZopeExt::testperl::testit called
> >
> > Please reply to me directly as I am not on the list.
> 
> Changing a perl external method can be a little flaky, try it a few more
> times to see if it works. Sometimes it does, sometimes it doesnt. You can
> get REQUEST straight from self which is what I have done:
> 
> my $self = shift;
> my %REQUEST = %{$self->{'REQUEST'}};
> 
> I tried this in an Internal method and got into some bother, so I'll have a
> closer look when I have more time.
> 
> HTH.
> 
> --
>   Andy McKay
> 
> 
> 

Andy,

I tried all of the things you suggested, and get the same error. I also
restarted Zope a couple of times and that didn't help either.

Regards,

Greg Green
Advanced Design Systems
Math & Computing Technology
Boeing
(425) 865-2790