DCPM: Newbie: Co-process pattern - examples of.

Simon Waters Simon at wretched.demon.co.uk
Wed Jul 2 08:41:22 CDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I want to write a Perl script that runs another program in parallel,
sending commands to its stdin, and parsing its stdout.

This is called a coprocess (at least in the Korn shell manual page).

I was looking for perl examples and/or modules to help.

The GnuPG module does this (if it can't use the gnupg shared memory
coprocess model), but it looks;

a) complicated (not least as it has two methods to communicate)
b) distinctly like the kind of thing that might already have been
packaged as a module.

search.cpan.org only came up with the "filter" co-process, but I
think(?) that is basically tacking a filter onto the end of your Perl
output, which is not what I want to do, but maybe I misunderstood?

My Perl skills are almost non-existent, so any examples I can find will
help enormously.

Also anyone done this under Windows? I'll be using an OS with it's own
fork call, but portability would be nice to have.

 Simon
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/AuEAGFXfHI9FVgYRAsmNAJ9NSt9Mn4xxZyuRBXH7BtpqDaatiQCfU2G+
RPd4xePYS2t9yWpd6xkulWA=
=GnaQ
-----END PGP SIGNATURE-----



More information about the Devoncornwall-pm mailing list