On Monday 11 March 2013 11:20:36 Chris Nighswonger wrote:

> 2.The second version imports a class from a Python module. The script
> runs fine when called from the cli. However, it borks when executed as
> a cgi, complaining of calls to undefined functions/methods. Of course,
> those functions/methods are in the Python module.

Can you post the script code? Or at least the part dealing with Python?
When importing Inline::Python it loads and runs the given Python code 
(containing the import statements). Then it inspects the main namespace and 
imports those names into the Perl namespace. I suspect that miniserv.pl 
trickery leads to namespace problems. So could you please try the 
py_new_object() and py_call_function() way of accessing Python? This avoids 
namespace magic and should be more reliable:

# create a Python foo.Bar object and make it look like a Bar object in Perl:
my $bar = py_new_object('Bar', 'foo', 'Bar', 'constructor arg 1');
$bar->baz();

Regards,
Stefan

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to