Skip to main content.
home | support | download

Back to List Archive

Re: Running programs on Windows

From: Anthony Baratta <Anthony(at)not-real.2plus2partners.com>
Date: Tue Sep 28 2004 - 17:20:57 GMT
Bill Moseley wrote:
> On Tue, Sep 28, 2004 at 09:41:58AM -0700, Anthony Baratta wrote:
> 
  >>Windows 2000 Server:
>>ActiveState v5.6.1 Build 638
>>(note: it does not like the waitpid line.
>>        26: waitpid $pid,0 || warn $!;)
> 
> 
> When you say it doesn't like it, does that mean it generates an error
> message?

Each run had this error message:

Bad file descriptor at C:\Program 
Files\SWISH-E\indexes\Tmp\bill_test_1.pl line
26, <r> line 9.

This is the code for the main program (bill_test_1.pl):

#!/usr/bin/perl -w
use strict;


use IPC::Open2;


#my @command = ( 'perl', 'my bill_test_2.pl', 'first arg1', '"second 
arg2"' );
my @command = (
       'perl',
       'my bill_test_2.pl',
       'first arg1',
       '"second arg2"',
       'word "quoted" and \"backslashed\" word',
       '"2word "quoted" and \"backslashed\" word"',
);


my $pid = IPC::Open2::open2( \*r, \*w, @command );


print "Pid = $pid\n";
print "output:\n";
print while $_ = <r>;
print "done\n";
waitpid $pid,0 || warn $!;
Received on Tue Sep 28 10:21:07 2004