That was what I found out and why I chose to use Win32::Process so that
interactive sessions/commands could be spawned without leaving the Perl
module in the lurch.  Try it, you'll like it.

-----Original Message-----
From: Kipp, James [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2003 4:09 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Can't fork using open


> 
> I just test ran the below and it worked fine. I am running 
> Win2k Pro, AS Perl 5.6.1 build 630:
> code adapted from the perlipd doc
> --
> $parent = $$;
> print "parent: $parent\n";
> $pid = open(STATUS, "netstat -an 2>&1 |") || die "can't fork: $!";
>     while (<STATUS>) {
>       #next if /^(tcp|udp)/i;
> }
> print "child: $pid\n";
> 
> close STATUS || die "bad netstat: $! $?";  
> ---

hmm.. The results weren't so good from the write side. It seems the fork and
spawn of the child works fine, however (as Jeff Smith mentioned in his post)
the forked process doesn't seem to return or at least in any set time. The
code below spawns the child but never returns:

open(TEST, "| notepad.exe") || die "can't fork: $!";
    print TEST "stuff\n";
    close TEST || die "bad cmd: $! $?";  
----
notepad opens but it never returns to do the write.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to