Date: 13 Aug 2003 10:34:20 +0200 Message-Id: From: Eli Zaretskii To: =?iso-8859-1?q?cyril=20cayla?= CC: djgpp AT delorie DOT com In-reply-to: <20030813072306.5893.qmail@web20802.mail.yahoo.com> (message from =?iso-8859-1?q?cyril=20cayla?= on Wed, 13 Aug 2003 09:23:06 +0200 (CEST)) Subject: Re: little problem References: <20030813072306 DOT 5893 DOT qmail AT web20802 DOT mail DOT yahoo DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk [Please keep this discussion on the mailing list, so others could chime in and help.] > Date: Wed, 13 Aug 2003 09:23:06 +0200 (CEST) > From: =?iso-8859-1?q?cyril=20cayla?= > > I can run some C programs compiled by djgpp called by > the function "system" in perl. My problem is then > specific to the program i've created. Yes. > I have to find why this prog.exe run perfectly in DOS > and not in from the Perl code. The answer might be in > this question: is there any problem with variables > with very long names in parameter? > [...] > the exact call is this: > system("prog \"".$workdir.$tiflist[$i+1]."\" > \"".$workdir.$tiflist[$i]."\" > \"".$workdir.$preprocess[1]."\" > \"".$workdir.$preprocess[2]."\" > \"".$workdir.$datfile."\" $pr $spotsize > $imageanalysistype $offsetadjust $controlimage > \"".$workdir.$jpgfile."\" 2>\"".$workdir."im.res\""); This is a very long command line. When non-DJGPP programs invoke DJGPP programs, they cannot pass commands longer than 126 characters to them. So to make this work, you need to use the response-file method of passing long command lines to DJGPP programs. That is, change your Perl script to write the command-line arguments (what follows "prog.exe" in your current script) to a file, and then invoke your program like this: system("prog.exe @file 2>\"".$workdir."im.res\"); where `file' is the name of the file where you put the rest of the command line.