i'm afraid your code is weird. who told you that opening a pipe forks to a new process, which then is under control by perl?
perldoc-f open says:
If the filename begins with '|', the filename is interpreted as a comm
+and to which output is to be piped, and if the filename ends with a '
+|', the filename is interpreted as a command which pipes output to us
+. See "Using open() for IPC" in perlipc for more examples of this.
the crucial words are:
the filename is interpreted as a command to which output is to be piped - which means that the new process's control is up to the shell, and no longer to perl.
if you really want to fork to a process you can talk to, you
will have to use one of the usual IPC methods. for convenience reasons i'd suggest you use sockets. but that's my personal opinion.
language is a virus from outer space.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.