Ask a Question related to Perl / CGI, Design and Development.
-
Tom Salzmann #1
Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache.
I have developed some perl code to run as a script under Windows 2000
running apache. This works GREAT on Win2k but on WinNT, perl is simply
unable to launch the program. The program works fine from the command line.
Here's the code:
$fred=time . ".out" ;
open(OUTPUT, "|imon.bat " . $fred . " " . $ENV{'REMOTE_ADDR'} . " " .
$IMCommand . " " . $IMFile );
close OUTPUT;
open(FILE, $fred );
@htmlLines = <FILE>;
close FILE ;
unlink($fred);
unlink($IMFile);
As a test to make sure I wasn't nuts, I put the following in the bat file:
ECHO >> echo.out
And sure enough, I get "ECHO IS ON" in the file every time I run from
command line. But when I run from Apache, I get NOTHING. It's as if Apache
is unable to launch the thing.
Again, this works FINE under Win2k but fails on WinNT - Any ideas? I tried
system() but I get the same thing.
Thanks,
Tom
Tom Salzmann Guest
-
Post Script - Hylafax - Text File - perl
I want to write a script that takes piped input and then fills out a purchase order form that can then be sent to Hylafax as a postscript file. ... -
Executing php from with a perl script
I know perl and can write the script. What I want to do is to be able to grab a page, pass it to php if it has the php extension, get the... -
Perl script checks for a file
Does anyone already have a perl script that checks to see if a file exists or not a Windows Platform? Anthony J Segelhorst Enterprise Systems... -
pipe a file to a perl script
On Tue, 12 Aug 2003, Asif Iqbal wrote: Nevermind , I found the answer. -- Asif Iqbal... -
Problem uploading file of large size in Perl/Apache/Linux
Hi need an urgent help!!!!!! I m facing problem with uploading a file to my server using http protocol I have one perl script which upload... -
Cat #2
Re: Problem executing a BAT file (or EXE file) using Perl as CGI scriptunder Apache.
Tom Salzmann wrote:
Check the Apache log files for clues>
> I have developed some perl code to run as a script under Windows 2000
> running apache. This works GREAT on Win2k but on WinNT, perl is simply
> unable to launch the program. The program works fine from the command line.
>
> Here's the code:
>
> $fred=time . ".out" ;
> open(OUTPUT, "|imon.bat " . $fred . " " . $ENV{'REMOTE_ADDR'} . " " .
> $IMCommand . " " . $IMFile );
> close OUTPUT;
> open(FILE, $fred );
> @htmlLines = <FILE>;
> close FILE ;
> unlink($fred);
> unlink($IMFile);
>
> As a test to make sure I wasn't nuts, I put the following in the bat file:
>
> ECHO >> echo.out
>
> And sure enough, I get "ECHO IS ON" in the file every time I run from
> command line. But when I run from Apache, I get NOTHING. It's as if Apache
> is unable to launch the thing.
>
> Again, this works FINE under Win2k but fails on WinNT - Any ideas? I tried
> system() but I get the same thing.
>
> Thanks,
>
> Tom
Include the full path to imon.bat and see if that works
Maybe try hard coding the parameters to imon.bat or simplifying it
eg open(OUTPUT, "|imon.bat 1234.out 127.0.0.1 echo test.txt");
inet.bat can be something like
ECHO %1 %2 %3 %4 >> echo.out
Cat Guest
-
Tom Salzmann #3
Re: Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache.
The return code I get is 65280... exit_code of 255.
??
Thoroughly confused...
Tom
"Tom Salzmann" <salzo@yahoo.com> wrote in message
news:zjUQa.458$x16.19236@eagle.america.net...> Cat, Thanks for the reply.
>
> I have tried your advice to no avail. The perl file works FINE from the
> commandline and it does RUN from apache (I echo things to the resulting
> html) but the calls to NT to run the BAT file fail... I tried it two ways
> this time - the open() approach and using system().
>
> Again, from the commandline, the PERL program runs the BAT file fine every
> time. From Apache, the perl file runs but the BAT file is apparently
> ignored.... I'll try to get return codes from system() next.
>
> Thanks!
> Tom
>
>
Tom Salzmann Guest
-
Cat #4
Re: Problem executing a BAT file (or EXE file) using Perl as CGI scriptunder Apache.
Tom Salzmann wrote:
Sorry i can't help you any further as I'm running Linux and W2K. But I'll>
> The return code I get is 65280... exit_code of 255.
>
> ??
>
> Thoroughly confused...
>
> Tom
>
> "Tom Salzmann" <salzo@yahoo.com> wrote in message
> news:zjUQa.458$x16.19236@eagle.america.net...> > Cat, Thanks for the reply.
> >
> > I have tried your advice to no avail. The perl file works FINE from the
> > commandline and it does RUN from apache (I echo things to the resulting
> > html) but the calls to NT to run the BAT file fail... I tried it two ways
> > this time - the open() approach and using system().
> >
> > Again, from the commandline, the PERL program runs the BAT file fine every
> > time. From Apache, the perl file runs but the BAT file is apparently
> > ignored.... I'll try to get return codes from system() next.
> >
keep thinking... good luck.
Cat Guest



Reply With Quote

