A couple things could be happening here.

How does the EXE being invoked by SYSTEM find the file it is trying to open?  Are you 
using relative paths?  If the file is on a WIN machine, you may need to double-back 
'\\' the path to the file so it can be found.

Second, how are you invoking SYSTEM?  Are you passing it an array with the arguments 
to execute?  I have found it is sometimes easier to assemble a large command string 
and pass that in instead of the parsed out array form.

--Brian


------Original Message------
From: "prachi shroff" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Sent: June 7, 2001 1:15:37 PM GMT
Subject: Re: system


Its the exe which cannot open another file........and I have to use system 
and not exec, coz I need to get back to the script after executing the exe.
So, the problem is, the exe has no problems opening the other file if run on 
the command prompt or by any other straight means, but if run within the 
perl script it shows errors. Also, I have run other exe from the same script 
and they work fine.

Thanks,
Prachi


----Original Message Follows----
From: Jean-Matthieu Guerin <[EMAIL PROTECTED]>
To: prachi shroff <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: system
Date: Thu, 07 Jun 2001 15:05:40 +0200

Hello,

Is your perl script that can't open exe file or your exe that can't open
another file ?

- if perl can't open exe file:
check that exe's path is defined on your PATH environment variable
or
if perl srcipt and exe are in same directory, check line
SYSTEM("./myexe.exe")
the ./ stands for current directory.
or
try another way than SYSTEM : exec, ` `, ...

prachi shroff wrote:
 >
 > Hi,
 >
 > I am trying to run an executable file from within my perl script using 
the
 > SYSTEM command. If I run the exe from either the command line or by 
double
 > clicking, it works fine, but when I embed it into the perl script it 
gives
 > errors compiling. It is an exe of a C code and shows errors specific to 
the
 > code like "error opening a file" that it needs to read.
 >
 > Could anyone please give in any suggestions.
 >
 > Thanks,
 > Prachi

--
--------------------------------------------------------
  Jean-Matthieu Guerin
                Brime Ingenierie
                 [EMAIL PROTECTED]
--------------------------------------------------------

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
***********************************
*  Brian P. Hanley
*  Senior Consultant
*  Verity Professional Services
*  Ph: 757.547.9638
*  Fx: 240.248.8902
*  e-mail: [EMAIL PROTECTED]
*  http://www.verity.com
***********************************
 

Reply via email to