Gossamer Forum
Home : General : Perl Programming :

.cgi result to .htm page?

Quote Reply
.cgi result to .htm page?
How would you save .cgi result in a browser to a different dir as .html page?

(ie I would have this button to press, if user wants to save it as .htm page)



Thanks
Quote Reply
Re: [Suomi] .cgi result to .htm page? In reply to
Can't you write the results to a temp file and then use file:copy?

Code:


use
File::Copy;

copy(
"temp.txt", "/path/to/different/directory/data.html") or die "copy failed: $!";
Quote Reply
Re: [Suomi] .cgi result to .htm page? In reply to
Oh ok, you want it to be done instantly from the form. The above may not be the best approach then.
Quote Reply
Re: [manunkind] .cgi result to .htm page? In reply to
Yeah its not actually a form, but as a test.cgi, which has nothing but html, when viewed source from the browser. I just need to be able to save that as a test.html page.

Thx
Quote Reply
Re: [Suomi] .cgi result to .htm page? In reply to
Seeing the code would help but can't you just store all your output in a variable and then just print it to the file?

my $output = qq|

my html here

|;

open FH, ">test.html" or barf;
print FH $output;
close FH;

Last edited by:

Paul: Mar 17, 2002, 7:49 AM
Quote Reply
Re: [Paul] .cgi result to .htm page? In reply to
Just take this page as an example (This forumpage)

Thx
Quote Reply
Re: [Paul] .cgi result to .htm page? In reply to
I am using dbsql and when user goes to their detail pages, I would like to provide there a button to click if he wants to make .html page from it... (This database is restricted, and thats why I need to find a way of making data public... if user wants it)

Thx


Just found this... should I try to use it? and how? getstore($url, $file)[/url] Gets a document identified by a URL and stores it in the file. The return value is the HTTP response code.

Last edited by:

Suomi: Mar 25, 2002, 9:31 PM