develooper Front page | perl.inline | Postings from April 2012

Re: call perl from python code

Thread Previous
From:
Stefan Seifert
Date:
April 22, 2012 11:44
Subject:
Re: call perl from python code
Message ID:
1739787.10vSQlXnFj@sphinx
Hi Stella,

On Sunday 22 April 2012 03:21:14 Stella Levin wrote:

> I have installed Inline::Python.
> Manual says: "perl is a Python module bundled with Inline::Python that gives
> you access to Perl from inside your Python code"- I cannot find this perl
> module under installation package - I cannot get working:

This may be a bit misleading. The "perl" module is only available in code 
running from Inline::Python. To expand your second example:

#!/usr/bin/perl
use 5.10.0;
sub test {
    say "Hello from Perl within Python";
}
use Inline Python => <<'END';
perl.test()
END

Regards,
Stefan

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About