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: $!";
In reply to Re: running an executable from a cgi script
by serf
in thread running an executable from a cgi script
by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |