I have searched a lot and I have understood that there exists inline::Python for putting in python code within Perl.. But I am looking for some means by which I can access modules and functions written in Perl by not writing any Perl code, through a python code.
Maybe, I am asking for too much?
Open your Python code in your Python editor of choice. Go to the line in the code where you want to run your Perl script. Type "pyth. RunPerl.
#!/usr/bin/python from perlfunc import perlfunc, perlreq, perl5lib @perlfunc @perlreq('very_old.pl') def hello(somebody): pass if __name__ == '__main__': assert(hello('python-visit-perl') == 'Hello, python-visit-perl! ')
If you would like to make a call to, or reference, a Perl script from within a different Perl script, you can accomplish this a system(), exec() or the backtick operator to the path for Perl. For example: system("/usr/bin/perl /path/to/my_script.pl ");
I believe this is the sort of thing that the Parrot project aims to allow. It's a VM that's supposed to be able to run various dynamic languages, including Python and Perl. I've no idea how ready it is for real use, though, and I've never seen any instructions for people wanting to use Parrot, rather than develop it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With