Bluehost.com Web Hosting $6.95

Perl and Apache, running system commands...

This is a discussion on Perl and Apache, running system commands... within the Windows Web Servers forums, part of the Web Server and Related Forums category; I need to make a system call within a cgi script, and I am having some trouble. I know that ...


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-29-2007
gocaveman
 
Posts: n/a
Default Perl and Apache, running system commands...

I need to make a system call within a cgi script, and I am having some
trouble. I know that I have done this before, but for some reason,
when I make the call, things hang, and the debug just before my system
call gets printed, but the debug after never gets printed.

I made s short .pl script, which works fine when I call "perl
system.pl" at the command prompt.
system.pl:
#!/usr/local/bin/Perl/bin/perl.exe -w
my $SUCCESS = 0;

my $cmd = "notepad.exe \"error.log\"";
(system($cmd) == $SUCCESS) or print("Notepad failed: $!\n");

Now, within the confines of my cgi script (running win32 with apache),
I am trying ($ME is defined to "filename.cgi:"):
don_common'log_to_file($msg_log, "$ME about to make notepad call");
my $cmd = "notepad.exe \"error.log\"";
(system($cmd) == $SUCCESS) or don_common'log_to_file("notepad failed:
$!\n");
don_common'log_to_file($msg_log, "$ME just made notepad call");

In my log file, I get the following output:
filename.cgi: about to make notepad call

Any ideas? I even tried to put a copy of notepad.exe in my cgi-bin
directory. The error.log is also in the same directory.

Thanks,

-Kevin

  #2 (permalink)  
Old 01-29-2007
gocaveman
 
Posts: n/a
Default Re: Perl and Apache, running system commands...

Even more interesting, is that notepad is apparently being called,
since it is in the process list, but the gui for notepad never gets
raised to the point to where it is displayed anywhere. Of course
after this point, Apache will wait for notepad to exit, which never
happens, and at some point goes into the error log when Apache
terminates the thread.

So, I tried closing STDIN and STDOUT, but it makes no difference. Any
ideas?

On Jan 29, 3:34 pm, "gocaveman" <kevinwh...@bellsouth.net> wrote:
> I need to make a system call within a cgi script, and I am having some
> trouble. I know that I have done this before, but for some reason,
> when I make the call, things hang, and the debug just before my system
> call gets printed, but the debug after never gets printed.
>
> I made s short .pl script, which works fine when I call "perl
> system.pl" at the command prompt.
> system.pl:
> #!/usr/local/bin/Perl/bin/perl.exe -w
> my $SUCCESS = 0;
>
> my $cmd = "notepad.exe \"error.log\"";
> (system($cmd) == $SUCCESS) or print("Notepad failed: $!\n");
>
> Now, within the confines of my cgi script (running win32 with apache),
> I am trying ($ME is defined to "filename.cgi:"):
> don_common'log_to_file($msg_log, "$ME about to make notepad call");
> my $cmd = "notepad.exe \"error.log\"";
> (system($cmd) == $SUCCESS) or don_common'log_to_file("notepad failed:
> $!\n");
> don_common'log_to_file($msg_log, "$ME just made notepad call");
>
> In my log file, I get the following output:
> filename.cgi: about to make notepad call
>
> Any ideas? I even tried to put a copy of notepad.exe in my cgi-bin
> directory. The error.log is also in the same directory.
>
> Thanks,
>
> -Kevin


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0