[Zope] Call to external perl method isn't passing 'self'

chris chris@valley-internet.com
Mon, 27 Jan 2003 00:38:00 -0800


I have a perl script running as an external method.  It has two arguments,
one being 'self' since I am changing some zope properties in the perl script
itself.

When called via html, such as by using the 'try it' link on the perl script
object, it works just fine.  When I try to call it using dtml, 'self' isn't
being passed at all, and I get a perl error saying I can't call a method on
an undefined object.

Here is the dtml tag.  I have tried a number of variances also trying to
find out why it won't work:

<dtml-call expr="clientinfo('chris')>


I also tried this with a regular zope perl script (restricted).  I created
an object using the following code and the single argument 'self'.

my $context = shift;
$a = $context->manage_addProperty('newid','HIYA','string');
return $a;


Then I called it using this line of dtml.

<dtml-call expr="perl()">

And got this error:
Error Type: PerlError
Error Value: Can't call method "manage_addProperty" on an undefined value at
perl line 2.

It of course works correctly using the Try it link, which is it returns
nothing at all..

I'm thinking this might be a bug, but then I'm pretty new to zope so I hate
to start yelling bug on my first post:)

Chris