hemanth
hemanth

Reputation: 352

Running Python scripts from Perl scripts

I have a complex state machine in Perl which would be call the perl library module supporting different functionality. Each of the library modules are called sequentially based on state machine in perl.

But now I have one of the library module (consisting of many API) in python scripts which is needs to be called from perl state machine.

Please suggest me as to how can I call the sub-routines in python from the perl state-machine.

Upvotes: 2

Views: 272

Answers (1)

cdarke
cdarke

Reputation: 44344

There is an Inline::Python on CPAN, but personally I have been unable to get that to work. Other than that, you can't. You will need to create a wrapper script (in Python) which does the calls you need and call that as a separate process. Depending on how the app is structured, you might have to pass data through some language neutral IPC mechanism like sockets or pipes.

Upvotes: 1

Related Questions