You are in a "while <STDIN>" loop. It will stay in the loop until it
reaches the EOF. Enter a "cntl Z" to break the loop.
Then, instead of trying to redirecting the print statements, redirect STDOUT
open(STDOUT, ">static.html");
print $q->header(),
$q->start_html (-title=>'generated HTML file'),
'Some output',
$q->end_html();
HTH
> -----Original Message-----
> From: Matthew Rochlin [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 24, 2000 10:36 AM
> To: Perl-Win32-Users Mailing List
> Subject: CGI.pm to a static file?
>
>
> (Running Activestate 5.6 on win2k):
>
> I'd like to use CGI.pm but send the output to a static HTML
> file instead of
> generating the page on the fly.
>
> I've got
>
> use CGI;
> $q = new CGI; # intitiate web page state
>
> Here's the prob. I'm running the program from the command prompt.
> When it hits the second line with "new CGI;", I get this in
> the console:
> (offline mode: enter name=value pairs on standard input)
> type in
> random
> stuff
>
> (the "type in\nrandom\nstuff" is from me entering junk into
> what looks for
> all the world like a "while <STDIN>" type loop. But I have
> to cntl C to
> get out.
>
> What I'd like to do is just print my HTML to a file handle like
> open (HTMLOUTPUT, ">newfile.html")
> $q= new CGI;
> print HTMLOUTPUT header(),
> start_html (-title=>'generated HTML file'),
> 'Some output',
> end_html();
>
> I tried using STDOUT as the file handle for my HTML file
> (overriding the
> default to the console) but that didn't appear to do anything.
>
> Suggestions?
> (By the way, I'm generating a static file because it takes a several
> minutes to run the CGI that generates the page content, so
> I'm doing it
> once it the morning and letting visitors see the static page.
> I'm -trying
> to- use CGI.pm instead of just printing to the HTML file
> handle because
> it'd be nice to use some of the CGI.pm convenient tag
> generating code.)
> Thanks,
> Matt Rochlin
>
> ---
> You are currently subscribed to perl-win32-users as:
> [EMAIL PROTECTED]
> To unsubscribe, forward this message to
> [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to
> [EMAIL PROTECTED]
>
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]