in reply to running an executable from a cgi script
This piece of code doesn't seem to do much yet (is it meant to be pseudo code?)
Things to think about:
(Or were you meaning to tell the CGI the path to a file sitting on the same server as itself? - which is what your question seems to indicate. If so you would only need to give it the local path to the file as far as the CGI program was concerned (or more securely the name of a file sitting in a predetermined directory on the server where the program *always* looked for its files.)
# path to program my $prog = '/local/path/to/cgi-bin/executableprog'; open(PROG, "| $prog") || die "Can't run '$prog': $!\n"; print PROG "$file\n"; close(PROG);
and then:my $pid = open PIPE, "-|";
PIPE and PROG were meant to be talking about the same process?exec PROG or die "Cannot open pipe to executableprog: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: running an executable from a cgi script
by Angharad (Pilgrim) on Feb 09, 2006 at 16:41 UTC |