[Zope-Perl] newbie Zope/Perl question

Monty Taylor mtaylor@goldridge.net
Tue, 24 Oct 2000 11:35:02 +0200


Well,
For one, you're gong to start a new process and a new interpreter for each
perl 'command' you want to run. The particular version you posted is going
to fail if username or password contain spaces, (and possible
meta-characters, I don't know commands too well) And you have no real
integration with the Zope environment. This example will work, but you
wouldn't be able to do more complex things like pass the REQUEST object
(or any other object ) to the script.

That being said, there is no 'technical' reason why you can't do this.
I would highly recommend using Perl Methods instead, as they can actually
interact with everything. One of the main benefits of Zope is that is
provides you a wonderful framework to work within, and doing this is
effectively subverting that.

But I do things I shouldn't all the time. :)

Monty

"Leichtman, David J" wrote:

> I'm new to the Zope world.
>
> Can someone explain to me why (other than the fact that it's messy) you
> can't call a Perl function like so:
>
> import commands
>
> def usercheck(username,password):
>         res = commands.getoutput ('/opt/zope/scripts/usercheck.pl
> '+username+' '+ password)
>         return res
>
> What potential problems might arise from this style of calling?
>
> _______________________________________________
> Zope-perl maillist  -  Zope-perl@zope.org
> http://lists.zope.org/mailman/listinfo/zope-perl