I have an application that spawns a detached process to run a Perl script, within which it expects to read a bunch of lines from STDIN. To do this, I have a simple construct like
-----------
while (<STDIN>)
{
$myline = $_;
(process my input line...)
}
------------


Before calling the perl script in the detached process, I define sys$input to the mailbox device the parent had created.

When the parent process writes text lines into the mailbox, I find that the detached process *does* receive them. After writing the necessary lines, I send an EOF character (decimal 26) to the mailbox expecting it to terminate read from STDIN and proceed further with the execution of the Perl script. However, that doesn't happen and the Perl execution remains in this while loop forever. Closing the channel of the mailbox after the write operation is not a desirable option at this point, since that could potentially break other non-perl related tasks that might require to keep the channel open from the parent side. ( I had a similar situation earlier where the 'perl' binary was invoked in the detached process without any arguments, and the Perl script itself was fed through the mailbox as STDIN to the detached process which seemed to hang forever too. I got over the hang by sending an EOF character as the last message on the mailbox. Looks like the EOF works for the Perl script itself on STDIN, but not read of data through STDIN as part of a Perl script)

Any suggestions,pointers welcome.

btw - The version of Perl is 5.6.1 on AlphaVMS Version 7.3-2.

Thanks,
Sam



Reply via email to