my $pid = open2(\*OUT, \*IN, '| findstr hello'); ^
You don't want the pipe in there...
Update: Next thing to consider would be to add some form of error handling. For example, this
my $pid; eval { $pid = open2(\*OUT, \*IN, "NotThere ..." ); }; if ($@ and $@ =~ /^open2:/) { die "$@: $!\n"; }
would produce
> perl 729630.pl open2: exec of NotThere ... failed at 729630.pl line 8 : No such file or directory
In reply to Re: open2 on windows
by almut
in thread open2 on windows
by mangetsu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |