Don't ask to ask, just ask | |
PerlMonks |
Re: How to display output in separate html form in cgi scriptby Kenosis (Priest) |
on Jan 24, 2014 at 04:29 UTC ( [id://1071874]=note: print w/replies, xml ) | Need Help?? |
If you're going the Perl CGI route, consider using the CGI module (sorry, chromatic). If I understand your question correctly, you want a separate CGI script and a resulting html document. That is, instead of a dynamically-created html document, you'd like a static html document created by the script. This can certainly be done, by writing the results to an html file, and then redirecting the browser to that file. You'd need write permissions for both the dir and file you're writing to. But now it gets a little messy... You'd need to create a unique filename for each response--for each new htnl document that the CGI script creates. Additionally, you'd need to figure a way to deal with all the html files that your CGI script is creating. Do you leave them in the directory? If you're going to delete them, how long after they're created and how often? You need to answer for yourself whether creating static html files from a CGI script is better than creating the pages 'on the fly,' as your script above does.
In Section
Seekers of Perl Wisdom
|
|