#!/usr/bin/perl use CGI; my $cgi = CGI->new(); if ($cgi->request_method() eq 'POST') { if (my ($my_param) = $cgi->param('my_param')) { print($cgi->header('text/plain')); close(STDERR); open(STDERR, '>&', \*STDOUT); exec 'my_prog', $my_param; } } print($cgi->header('text/html')); print(<<'__EOI__'); <title>my_prog</title> <form method="POST"> <h1>my_prog</h1> <p>my_param: <input type="text" name="my_param"> </form> __EOI__ }
In reply to Re: Port a script with STDIN/STDOUT to CGI?
by ikegami
in thread Port a script with STDIN/STDOUT to CGI?
by spickles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |