Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

This module provides a way to execute perl statements in a parallel perl process.

Project description

A priori, it is a strange idea to execute pieces of perl code from a python program, unless you have to use an existing perl API and you want to write as less perl code as possible. In this case (and only it, in my opinion), perlprocess may help you. See VMPython as an example of use.

When a perlprocess object is created, a separate process is launched, running a small perl script that expects commands on STDIN. If a string is given as parameter to the perlprocess constructor, it is used as a prolog for the perl script. It is usefull mainly to declare use clauses or some useful functions.

When invoking the run(command) method of the perlprocess object, the command is sent to the perl process as a string containing eventually several perl statements, eventually among several lines. This string is evaluated, the result is printed on stdout. If an error occurs (perl variable $@ not empty), PerlRuntimeError is raised. If you define a perl variable of any kind in the perl process, this variable remains alive until you undefine it.

Project details


Release history Release notifications

This version
History Node

0.1

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page