|more useful options
open(TO, "|-") is a bad file name?by SavannahLion (Pilgrim)
|on Feb 24, 2004 at 01:36 UTC
SavannahLion has asked for the wisdom of the Perl Monks concerning the following question:
I have a process that I would like to fork at least three times. Twice to launch little helper apps on my PC and another to do some tiddly stuff with another running application.
I have zero problems creating three seperate scripts to do what I want them to do. But I want to merge the code from all three into one single script. So I figured a fork would work nicely. Problem is, all the examples I've seen out there show how to Fork only once. For example:
No problem with two things. But how do I get three going? So I looked around and figured maybe I should create a pipe the forked children and tell it what I want it to do (two of the processes launch help apps, so they use the same generic code). So I looked in the camel and located the following snippet:
OK. So, put my pieces together, run script and it dies with, "Bad command or file name."
That's nice, after a bit of testing, I figure out that Windows thinks I want a file named |-.
Now I'm stuck. Did a search for |- and only one node came up. Not what I was looking for.
So then I tried "Pipe Child" and "Pipe STDIN" and couldn't discover the little nugget.
Again, the Camel has another example on how to use Pipe to communicate with children. I type the code example in the book to open a pipe to my child:
And the Perl script dies with a "Not enough arguments for select system call" along with a syntax error.... grrr.....
I've examined this code and compared it to the book character and character. I've left the entire script out, but the code is exactly as it's presented to me in the Camel.