>Thanks Jay and Tom! I added this little bit to my script:
>
>select (CHILD);
>$| = 1;
>select (STDOUT);
>
>and it worked just as I expected it to. It's interesting, though,
>that I've been working with sockets a bunch through IO::Socket and my
>print statements seem to print to the socket strea
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote:
Thanks Jay and Tom! I added this little bit to my script:
select (CHILD);
$| = 1;
select (STDOUT);
and it worked just as I expected it to. It's interesting, though,
that I've been working with sockets a bunch through IO::Socket and my
print
On 11/8/06, Jay Savage <[EMAIL PROTECTED]> wrote:
There are a couple of things going on here.
First, the issue of what prints when is driven by buffering. Since you
haven't turned on autofulsh on any of your file handles, the buffer is
flushed whenever it's convenient for the the system. The res
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote:
print CHILD "printing to child\n";
sleep 5;
Concurrent processes can be counterintuitive at times. Because the
CHILD filehandle is buffered, that line won't necessarily be sent to
the child process right away. In your program, I'd expe
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote:
use strict;
use warnings;
print "First Trial:\n\n";
if (open(CHILD, "|-"))
{
print "parent starts: ", (scalar localtime),"\n";
sleep 5;
print "parent ends: ", (scalar localtime),"\n";
}
else
{
print "child starts: ", (scalar l
On 11/8/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
Jen Spinney wrote:
> Hello all!
Hello,
> print "\nSecond Trial:\n\n";
>
> if (open(CHILD, "|-"))
> {
>print "parent starts: ", (scalar localtime),"\n";
>print CHILD "printing to child\n";
>sleep 5;
>print "parent ends: ", (sca
Jen Spinney wrote:
> Hello all!
Hello,
> print "\nSecond Trial:\n\n";
>
> if (open(CHILD, "|-"))
> {
>print "parent starts: ", (scalar localtime),"\n";
>print CHILD "printing to child\n";
>sleep 5;
>print "parent ends: ", (scalar localtime),"\n";
> }
> else
> {
>my $time = sc