pipe-open on win32



Hi,

I'm having some trouble doing a pipe-open on Win32.
I suppose I was under the impression that perl
performed some magic when it encounters the '-|',
but it appears to simply pass the string to the
shell:

use strict;
use warnings;

print "Starting...\n";
unless (open (F, '-|')) {
open STDERR, ">&=1";
exec qw/ping localhost/;
die $!;
}
my $buf = "";
while (<F>) {
$buf .= $_;
print "Buffer:\n $buf\n";
}
print "Done!\n";
__END__
Starting...
'-' is not recognized as an internal or external command,
operable program or batch file.
Done!

I'm using Activestate 5.8.4. perlipc didn't suggest platform
specific quirks (unless I missed something) and nor did
the "Windows specific quirks" documentation in my version of
Perl mention pipe opens.

Is it possible to successfully do this type of open on
Windows?

bdm

.



Relevant Pages

  • Re: GUI and Rapid Application Development?
    ... Most simple applications that I dealt with did not need the use of API ... I imagine Perl is faster, ... my Perl scripts are more compact ... Chirag> in Windows that could run on Windows 98 through 2003. ...
    (comp.os.linux.misc)
  • Re: ping Purl Gurl? Beginner Level Perl
    ... Purl Gurl wrote: ... If you are to learn Perl, ... Windows machines is good motivation for using Win. ...
    (alt.usage.english)
  • Re: My Regexp XML Parser -> Structured Perl Data, Cut & Paste Version, No Modules (Vol I)
    ... On Windows NT and later, subprocesses are now started via ``cmd /x/d/c'' ... Perl for ISAPI would sometimes close a filehandle twice. ...
    (comp.lang.perl.misc)
  • Re: Unix commands
    ... ==> writing the program in Perl, ... ==> program that had to be ported to Windows. ... After installing a Unix toolkit the script ... And every other common Unix tool. ...
    (comp.lang.perl.misc)
  • Re: Unix commands
    ... I don't recall ever writing a program that needed to trawl through ... All the Perl programs ... I'm not going to worry whether my tool is going to be run on Windows. ... // Actually many times I've ported my programs and tools to Unix too! ...
    (comp.lang.perl.misc)