home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!gossip.pyramid.com!decwrl!concert!rock!fletcher!mcmahan
- From: mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner)
- Subject: Process question...
- Message-ID: <1992Jul22.231637.23043@cs.unca.edu>
- Organization: University of North Carolina at Asheville
- X-Newsreader: Tin 1.1 PL3
- Date: Wed, 22 Jul 1992 23:16:37 GMT
- Lines: 36
-
- This has stumped me.
-
- I want to fork off a process, but be able to read the forked
- processes' stdout in the parent, as well as feed the forked process
- stdin from the parent. Preferably an execed process. :)
-
- ________________
- | main ^ V |
- ________|____|_|
- ?| ?| stdin __________________
- | |---------------->| forked process |
- | -----V------------
- |<--------------------------| stdout
-
- How to do this in perl has baffled me, and I don't see it in the FAQ.
- I suspect there's some kind of file or pipe involved, but beyond that
- I'm lost.
-
- Luckily there are people on this newsgroup who've forgotten more about
- Perl than I'll ever know!
-
- Maybe an example would help...
-
- fork a process that will exec 'sort'
- parent feeds sort a bunch of words, and reads sort's output for use later.
-
- (I know you can sort in perl, it's just an example! :))
-
- or
-
- fork and exec inews
- feed it a post
- read the output and decide whether to bother a human about it
-
- Scott
-
-