Angharad has asked for the wisdom of the Perl Monks concerning the following question:
This code should result in a text file being created. I guess I have to determine where that will be placed on the server too? I have only just started playing with cgi and would appreciate any advice thrown my way. Thanks a lot.#!/usr/bin/perl use CGI; # eventually the text file will be sent to this excutable via the uplo +ad script $file = 'http://www.mywebpage/uploaded_files/file.txt'; # path to program my $prog = 'http://www.mywebpage/cgi-bin/executableprog'; my $q = new CGI; my $pid = open PIPE, "-|"; die "Cannot fork $!" unless defined $pid; unless($pid) { exec PROG or die "Cannot open pipe to executableprog: $!"; print PROG "$file\n"; close PROG; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: running an executable from a cgi script
by serf (Chaplain) on Feb 09, 2006 at 16:18 UTC | |
by Angharad (Pilgrim) on Feb 09, 2006 at 16:41 UTC | |
|
Re: running an executable from a cgi script
by swkronenfeld (Hermit) on Feb 09, 2006 at 16:32 UTC | |
|
Re: running an executable from a cgi script
by Angharad (Pilgrim) on Feb 09, 2006 at 16:35 UTC | |
by swkronenfeld (Hermit) on Feb 09, 2006 at 16:42 UTC | |
by Angharad (Pilgrim) on Feb 09, 2006 at 16:48 UTC | |
by swkronenfeld (Hermit) on Feb 09, 2006 at 16:58 UTC | |
by Angharad (Pilgrim) on Feb 09, 2006 at 17:05 UTC |