12

my question is the inverse of this one. In particular, I've dozens of existing modules written in Perl, some are object oriented and others just export a group of functions. Now since I have to write certain scripts in python but still would like to call those Perl modules, I'm wondering

1) if it is achievable, and

2) if so, what would be the best way of doing it

Ideally, the Perl modules would appear as "black boxes" to Python, so to speak. Something like:

 from perl_module import *
 return_value = perl_func(arg1, arg2, ...)

and

 object = perl_module.new()
 object.method1(arg1, arg2, ...)

but I'm sure to achieve this one needs to have something else imported / running at the background, if possible at all. Anything that is the counterpart to the Inline::Python would also be nice (but not ideal). Thx!

1 Answer 1

6
  1. http://wiki.python.org/moin/PyPerl
  2. http://www.boriel.com/files/perlfunc.py
Sign up to request clarification or add additional context in comments.

3 Comments

fyi, pyperl hasn't been under development for a number of years, as far as I can tell from this link
Reminds me of RSPerl, which has been out of maintenance and is broken at numerous places even though it boasts as the most viable connection from Perl to R... Guess I'll try PyPerl to find out.
Here is the the original post for perlfunc.py, it explains how to use the module: boriel.com/2007/01/21/calling-perl-from-python/?lang=en

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.