this is driving me crazy.  i worked on it for hours and cant figure it out.

i have an execuatable program, written in C, that prints its result as a string
to the terminal.   and this program definitely works correctly on WinXP or
Win98.  it prints the result to the screen.  big deal, right?

when i call this executable from Perl, on my WinXP system, and assign its
resulting output to a variable, it works great.  i'm able to parse the result
for the values im looking for.

but when i call this executable from Perl on a Win98 system, it will not assign
the resulting output at all.  it wont even print it to the screen.  

ive tried a number of methods:

   $result=system("myprogram.exe $arguments");
   print "     found:  [$result]\n";

or

   $result=`myprogram.exe $arguments`;
   print "     found:  [$result]\n";

or even

    $pid = open (FH, "myprogram.exe $arguments |")
    or die "couldn't fork! $!\n";
    while (1) {
        $result = (<FH>);
        if ($result) {
            print "     found:  [$result]\n";
            last;
        }
    }
    close FH;

all of these 3 methods work correctly on WinXP, but none of them work on Win98.
  

on Win98 the first (system) method returns zero (0) signifying (i assume) that
the program executed successfully.   the second (backtick) method, on Win98,
returns nothing.  just a blank.  the third method (filehandle pipe), on Win98,
just hangs forever in the while loop.

i even went into the C program, and added some code to *write the output to a
text file*.  i recompiled the C program, and when i run the program alone, on
*either* WinXP or Win98, it works correctly.   it prints its output to the
screen *and* writes the same output to a text file.

BUT...  when i run any one of the above perl scripts to call this executable
within Perl,  it does NOT work on Win98.  it will NEITHER find the output NOR
write the text file. 

of course, if i run any of the perl scripts on WinXP, it will both find the
output, assign it to the perl variable $result, and the proper textfile will be
written.

needless to say, this is driving me ABSOLUTELY NUTS!   :-P

my perl program and the compiled executables are the same programs.  i dont
have different programs being called here.  they are the exact same files,
pulled from a networked drive.

can someone help me please?

thanks

robert





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to